Mercurial > pub > Impl
comparison lib/IMPL/ORM/Schema/Field.pm @ 407:c6e90e02dd17 ref20150831
renamed Lib->lib
author | cin |
---|---|
date | Fri, 04 Sep 2015 19:40:23 +0300 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
406:f23fcb19d3c1 | 407:c6e90e02dd17 |
---|---|
1 package IMPL::ORM::Schema::Field; | |
2 use strict; | |
3 use warnings; | |
4 | |
5 use parent qw(IMPL::DOM::Node); | |
6 use IMPL::Class::Property; | |
7 | |
8 BEGIN { | |
9 public property fieldName => prop_get | owner_set; | |
10 public property fieldType => prop_get | owner_set; | |
11 public property fieldNullbale => prop_get | owner_set; | |
12 } | |
13 | |
14 our %CTOR = ( | |
15 'IMPL::DOM::Node' => sub { nodeName => 'Field' } | |
16 ); | |
17 | |
18 sub CTOR { | |
19 my ($this,$name,$type,$nullable) = @_; | |
20 | |
21 $this->fieldName($name) or die new IMPL::InvalidArgumentException('A name is required for the field'); | |
22 $this->fieldType($type) or die new IMPL::InvalidArgumentException('A type is required for the field'); | |
23 $this->fieldNullbale(1) if $nullable; | |
24 } | |
25 | |
26 sub canHaveChildren { | |
27 0; | |
28 } | |
29 | |
30 1; |