X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=blobdiff_plain;f=vendor%2Fzf2biz%2FCustom%2FModel%2FEntity.php;h=f261e5a4d43d2ca53189db7682ba1f21aa41149c;hp=7788491c34028d879dca52e9b06e1521204afb2e;hb=590d9e5f7f81b81a4a62fb0795e029ef91441e60;hpb=8ce32d13a3301c30a9e7bc7a17985ccfd6415b96 diff --git a/vendor/zf2biz/Custom/Model/Entity.php b/vendor/zf2biz/Custom/Model/Entity.php index 7788491..f261e5a 100644 --- a/vendor/zf2biz/Custom/Model/Entity.php +++ b/vendor/zf2biz/Custom/Model/Entity.php @@ -1,9 +1,19 @@ columns as $col) { @@ -23,6 +33,14 @@ class Entity return $result; } + public function getArrayCopy() { + $result = array(); + foreach($this->columns as $col) { + $result[$col] = $this->$col; + } + return $result; + } + public function toUpdatableArray() { $result = array(); foreach($this->updatable_columns as $col) { @@ -38,4 +56,39 @@ class Entity } return $result; } + + + + public function setInputFilter(InputFilterInterface $inputfilter) + { + $this->inputFilter = $inputFilter; + } + + public function getInputFilter() + { + if (!$this->inputFilter) { + $this->setDefaultInputFilter(); + } + return $this->inputFilter; + } + + protected function setDefaultInputFilter() + { + $inputFilter = new InputFilter; + $factory = new InputFactory; + + for ($this->getDefaultInputFilterArrays() as $params) { + $inputFilter->add($factory->createInput($params)) + } + $this->inputFilter = $inputFilter; + + return $this->inputFilter; + + } + + protected function getDefaultInputFilterArrays() + { + return array(); + } + }