diff Lib/Schema/Form/Field.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 16ada169ca75
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/Schema/Form/Field.pm	Tue Jul 14 12:54:37 2009 +0400
@@ -0,0 +1,33 @@
+package Schema::Form::Field;
+use strict;
+use Common;
+use base qw(Schema::Form::Item);
+
+BEGIN {
+    DeclareProperty Format => ACCESS_READ;
+}
+
+sub CTOR {
+    my ($this,%args) = @_;
+    
+    $args{'Format'} or die new Exception('A format is required for a field');
+    
+    $args{'Attributes'} = { %{$args{Format}->Attributes},%{$args{Attributes} || {} } };
+    
+    $this->SUPER::CTOR(@args{qw(Name isMulti Filters Attributes)});
+    $this->{$Format} = $args{'Format'};
+}
+
+=pod
+Ñíà÷àëà ïðèìåíèòü ôèëüòðû ôîðìàòà à ïîòîì ôèëüòðû ïîëÿ
+=cut
+sub Filters {
+    my ($this) = @_;
+    
+    my @filters = $this->{$Format}->Filters;
+    push @filters,$this->SUPER::Filters;
+    
+    return @filters;
+}
+
+1;