InnerMetaProperty.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2007 by Konstantin V. Arkhipov                          *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00017     final class InnerMetaProperty extends LightMetaProperty
00018     {
00022         public static function create()
00023         {
00024             return new self;
00025         }
00026         
00027         public function isBuildable($array, $prefix = null)
00028         {
00029             return true;
00030         }
00031         
00032         public function fillMapping(array $mapping)
00033         {
00034             return
00035                 array_merge(
00036                     $mapping,
00037                     $this->getProto()->getMapping()
00038                 );
00039         }
00040         
00044         public function fillForm(Form $form, $prefix = null)
00045         {
00046             foreach ($this->getProto()->getPropertyList() as $property) {
00047                 $property->fillForm($form, $this->getName().':');
00048             }
00049             
00050             return $form;
00051         }
00052         
00053         public function fillQuery(
00054             InsertOrUpdateQuery $query,
00055             Prototyped $object
00056         )
00057         {
00058             return
00059                 $this->getProto()->fillQuery(
00060                     $query,
00061                     $object->{$this->getGetter()}()
00062                 );
00063         }
00064         
00065         public function toValue(ProtoDAO $dao = null, $array, $prefix = null)
00066         {
00067             $proto = $this->getProto();
00068             
00069             return $proto->completeObject(
00070                 $proto->makeOnlyObject(
00071                     $this->getClassName(), $array, $prefix
00072                 ),
00073                 $array,
00074                 $prefix
00075             );
00076         }
00077         
00081         public function getProto()
00082         {
00083             return call_user_func(array($this->getClassName(), 'proto'));
00084         }
00085         
00086         public function isFormless()
00087         {
00088             return true;
00089         }
00090     }
00091 ?>