comparison Lib/IMPL/DOM/Property.pm @ 38:d660fb38b7cc

small fixes ORM shema to SQL schema transformation
author Sergey
date Mon, 23 Nov 2009 17:57:07 +0300
parents 94d47b388442
children 16ada169ca75
comparison
equal deleted inserted replaced
37:c2e7f7c96bcd 38:d660fb38b7cc
23 23
24 no strict 'refs'; 24 no strict 'refs';
25 die new IMPL::InvalidOperationException("Custom mutators are not allowed","${class}::$name") if ref $mutators; 25 die new IMPL::InvalidOperationException("Custom mutators are not allowed","${class}::$name") if ref $mutators;
26 if (($mutators & prop_all) == prop_all) { 26 if (($mutators & prop_all) == prop_all) {
27 *{"${class}::$name"} = sub { 27 *{"${class}::$name"} = sub {
28 $_[0]->Property($name,@_[1..$#_]); 28 $_[0]->nodeProperty($name,@_[1..$#_]);
29 }; 29 };
30 $propInfo->canGet(1); 30 $propInfo->canGet(1);
31 $propInfo->canSet(1); 31 $propInfo->canSet(1);
32 } elsif( $mutators & prop_get ) { 32 } elsif( $mutators & prop_get ) {
33 *{"${class}::$name"} = sub { 33 *{"${class}::$name"} = sub {
34 die new IMPL::InvalidOperationException("This is a readonly property", "${class}::$name") if @_>1; 34 die new IMPL::InvalidOperationException("This is a readonly property", "${class}::$name") if @_>1;
35 $_[0]->Property($name); 35 $_[0]->nodeProperty($name);
36 }; 36 };
37 $propInfo->canGet(1); 37 $propInfo->canGet(1);
38 $propInfo->canSet(0); 38 $propInfo->canSet(0);
39 } elsif( $mutators & prop_set ) { 39 } elsif( $mutators & prop_set ) {
40 *{"${class}::$name"} = sub { 40 *{"${class}::$name"} = sub {
41 die new IMPL::InvalidOperationException("This is a writeonly property", "${class}::$name") if @_<2; 41 die new IMPL::InvalidOperationException("This is a writeonly property", "${class}::$name") if @_<2;
42 $_[0]->Property($name,@_[1..$#_]); 42 $_[0]->nodeProperty($name,@_[1..$#_]);
43 }; 43 };
44 $propInfo->canGet(0); 44 $propInfo->canGet(0);
45 $propInfo->canSet(1); 45 $propInfo->canSet(1);
46 } else { 46 } else {
47 die new IMPL::InvalidOperationException("Invalid value for the property mutators","${class}::$name",$mutators); 47 die new IMPL::InvalidOperationException("Invalid value for the property mutators","${class}::$name",$mutators);