| 
49
 | 
     1 package IMPL::ORM::Schema::Field;
 | 
| 
 | 
     2 use strict;
 | 
| 
 | 
     3 use warnings;
 | 
| 
 | 
     4 
 | 
| 
 | 
     5 use base qw(IMPL::DOM::Node);
 | 
| 
 | 
     6 use IMPL::Class::Property;
 | 
| 
 | 
     7 
 | 
| 
 | 
     8 BEGIN {
 | 
| 
 | 
     9     public property fieldName => prop_get | owner_set;
 | 
| 
 | 
    10     public property fieldType => prop_get | owner_set;
 | 
| 
 | 
    11     public property fieldNullbale => prop_get | owner_set;
 | 
| 
 | 
    12 }
 | 
| 
 | 
    13 
 | 
| 
 | 
    14 our %CTOR = (
 | 
| 
 | 
    15     'IMPL::DOM::Node' => sub { nodeName => 'Field' }
 | 
| 
 | 
    16 );
 | 
| 
 | 
    17 
 | 
| 
 | 
    18 sub CTOR {
 | 
| 
 | 
    19     my ($this,$name,$type,$nullable) = @_;
 | 
| 
 | 
    20     
 | 
| 
 | 
    21     $this->fieldName($name) or die new IMPL::InvalidArgumentException('A name 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;
 | 
| 
 | 
    24 }
 | 
| 
 | 
    25 
 | 
| 
 | 
    26 sub canHaveChildren {
 | 
| 
 | 
    27     0;
 | 
| 
 | 
    28 }
 | 
| 
 | 
    29 
 | 
| 
 | 
    30 1;
 |