Mercurial > pub > Impl
comparison Lib/IMPL/ORM/Entity.pm @ 27:b544a772b654
ORM in progress
| author | Sergey |
|---|---|
| date | Fri, 16 Oct 2009 16:37:53 +0400 |
| parents | 03e58a454b20 |
| children | 6d33f75c6e1f |
comparison
equal
deleted
inserted
replaced
| 26:c529d386d80e | 27:b544a772b654 |
|---|---|
| 1 package IMPL::ORM::Entity; | 1 package IMPL::ORM::Entity; |
| 2 use strict; | 2 use strict; |
| 3 use warnings; | 3 use warnings; |
| 4 | 4 |
| 5 use base qw(IMPL::DOM::Node); | 5 use base qw(IMPL::Object); |
| 6 use IMPL::Class::Property; | 6 use IMPL::Class::Property; |
| 7 use IMPL::Class::Property::Direct; | |
| 7 | 8 |
| 8 # Name | 9 BEGIN { |
| 9 # Fields | 10 public _direct property Name => prop_get; |
| 10 # Relations | 11 public _direct property Class => prop_get; |
| 12 public _direct property Values => prop_get; | |
| 13 public _direct property Schema => prop_get; | |
| 14 } | |
| 11 | 15 |
| 16 sub CTOR { | |
| 17 my ($this,$class,$schema) = @_; | |
| 18 | |
| 19 | |
| 20 } | |
| 21 | |
| 22 sub Store; | |
| 23 *Store = \&dbgStore; | |
| 24 | |
| 25 sub dbgStore { | |
| 26 my ($this,$prop,$value) = @_; | |
| 27 | |
| 28 if ( my $container = $this->{$Values}{$prop} ) { | |
| 29 if ($container->{type} eq 'SCALAR') { | |
| 30 | |
| 31 } else { | |
| 32 | |
| 33 } | |
| 34 | |
| 35 } else { | |
| 36 die new IMPL::InvalidOperationException("Property not found",$this->Name,$prop); | |
| 37 } | |
| 38 } | |
| 39 | |
| 40 sub Get { | |
| 41 | |
| 42 } | |
| 12 | 43 |
| 13 1; | 44 1; |
