comparison Lib/IMPL/ORM/Schema/Field.pm @ 38:d660fb38b7cc

small fixes ORM shema to SQL schema transformation
author Sergey
date Mon, 23 Nov 2009 17:57:07 +0300
parents 6d33f75c6e1f
children 16ada169ca75
comparison
equal deleted inserted replaced
37:c2e7f7c96bcd 38:d660fb38b7cc
6 use IMPL::Class::Property; 6 use IMPL::Class::Property;
7 7
8 BEGIN { 8 BEGIN {
9 public property fieldName => prop_get | owner_set; 9 public property fieldName => prop_get | owner_set;
10 public property fieldType => prop_get | owner_set; 10 public property fieldType => prop_get | owner_set;
11 public property fieldNullbale => prop_get | owner_set;
11 } 12 }
12 13
13 our %CTOR = ( 14 our %CTOR = (
14 'IMPL::DOM::Node' => sub { nodeName => 'Field' } 15 'IMPL::DOM::Node' => sub { nodeName => 'Field' }
15 ); 16 );
16 17
17 sub CTOR { 18 sub CTOR {
18 my ($this,$name,$type) = @_; 19 my ($this,$name,$type,$nullable) = @_;
19 20
20 $this->fieldName($name) or die new IMPL::InvalidArgumentException('A name is required for the field'); 21 $this->fieldName($name) or die new IMPL::InvalidArgumentException('A name is required for the field');
21 $this->fieldType($type) or die new IMPL::InvalidArgumentException('A type 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;
22 } 24 }
23 25
24 sub canHaveChildren { 26 sub canHaveChildren {
25 0; 27 0;
26 } 28 }