Mercurial > pub > Impl
comparison Lib/IMPL/Object/Autofill.pm @ 206:c8fe3f84feba
+IMPL::Web::Handlers::ViewSelector
+IMPL::Web::Handlers::ErrorHandler
*IMPL::Web::Handlers::RestController moved types mappings to ViewSelector
author | sergey |
---|---|
date | Thu, 03 May 2012 16:48:39 +0400 |
parents | 2ffe6f661605 |
children | 47f77e6409f7 |
comparison
equal
deleted
inserted
replaced
205:891c04080658 | 206:c8fe3f84feba |
---|---|
56 my $mutators = $_->Mutators; | 56 my $mutators = $_->Mutators; |
57 ref $mutators ? (exists $mutators->{set}) : ($mutators & prop_set || $_->Implementor->isa('IMPL::Class::Property::Direct')); | 57 ref $mutators ? (exists $mutators->{set}) : ($mutators & prop_set || $_->Implementor->isa('IMPL::Class::Property::Direct')); |
58 } $class->get_meta('IMPL::Class::PropertyInfo')) { | 58 } $class->get_meta('IMPL::Class::PropertyInfo')) { |
59 my $name = $prop_info->Name; | 59 my $name = $prop_info->Name; |
60 if (ref $prop_info->Mutators || !$prop_info->Implementor->isa('IMPL::Class::Property::Direct')) { | 60 if (ref $prop_info->Mutators || !$prop_info->Implementor->isa('IMPL::Class::Property::Direct')) { |
61 $text .= "\t\$this->$name(\$fields->{$name}) if exists \$fields->{$name};\n"; | 61 $text .= " \$this->$name(\$fields->{$name}) if exists \$fields->{$name};\n"; |
62 } else { | 62 } else { |
63 my $fld = $prop_info->Implementor->FieldName($prop_info); | 63 my $fld = $prop_info->Implementor->FieldName($prop_info); |
64 if ($prop_info->Mutators & prop_list) { | 64 if ($prop_info->Mutators & prop_list) { |
65 $text .= "\t\$this->{$fld} = IMPL::Object::List->new ( ref \$fields->{$name} ? \$fields->{$name} : [\$fields->{$name}] ) if exists \$fields->{$name};\n"; | 65 $text .= " \$this->{$fld} = IMPL::Object::List->new ( ref \$fields->{$name} ? \$fields->{$name} : [\$fields->{$name}] ) if exists \$fields->{$name};\n"; |
66 } else { | 66 } else { |
67 $text .= "\t\$this->{$fld} = \$fields->{$name} if exists \$fields->{$name};\n"; | 67 $text .= " \$this->{$fld} = \$fields->{$name} if exists \$fields->{$name};\n"; |
68 } | 68 } |
69 } | 69 } |
70 } | 70 } |
71 } else { | 71 } else { |
72 # meta not supported | 72 # meta not supported |
73 #$text .= "\t".'$this->$_($fields->{$_}) foreach keys %$fields;'."\n"; | 73 #$text .= " ".'$this->$_($fields->{$_}) foreach keys %$fields;'."\n"; |
74 } | 74 } |
75 $text .= "}\n\\&_impl_object_autofill;"; | 75 $text .= "}\n\\&_impl_object_autofill;"; |
76 return eval $text; | 76 return eval $text; |
77 } | 77 } |
78 } | 78 } |