49
|
1 package Schema::Form::Field;
|
|
2 use strict;
|
|
3 use Common;
|
|
4 use base qw(Schema::Form::Item);
|
|
5
|
|
6 BEGIN {
|
|
7 DeclareProperty Format => ACCESS_READ;
|
|
8 }
|
|
9
|
|
10 sub CTOR {
|
|
11 my ($this,%args) = @_;
|
|
12
|
|
13 $args{'Format'} or die new Exception('A format is required for a field');
|
|
14
|
|
15 $args{'Attributes'} = { %{$args{Format}->Attributes},%{$args{Attributes} || {} } };
|
|
16
|
|
17 $this->SUPER::CTOR(@args{qw(Name isMulti Filters Attributes)});
|
|
18 $this->{$Format} = $args{'Format'};
|
|
19 }
|
|
20
|
|
21 =pod
|
|
22 Сначала применить фильтры формата а потом фильтры поля
|
|
23 =cut
|
|
24 sub Filters {
|
|
25 my ($this) = @_;
|
|
26
|
|
27 my @filters = $this->{$Format}->Filters;
|
|
28 push @filters,$this->SUPER::Filters;
|
|
29
|
|
30 return @filters;
|
|
31 }
|
|
32
|
|
33 1;
|