From: Sébastien CHAZALLET Date: Tue, 6 Nov 2012 15:57:09 +0000 (+0100) Subject: Rajout d'une bibliothèque Custom X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=commitdiff_plain;h=3a8463aa368c12c7f159de91e11c3046c2ab783e Rajout d'une bibliothèque Custom --- diff --git a/vendor/zf2biz/Custom/Model/Entity.php b/vendor/zf2biz/Custom/Model/Entity.php new file mode 100644 index 0000000..7788491 --- /dev/null +++ b/vendor/zf2biz/Custom/Model/Entity.php @@ -0,0 +1,41 @@ +columns as $col) { + if (array_key_exists($col, $data)) { + $this->$col = $data[$col]; + } elseif ($overwrite) { + $this->$col = null; + } + } + } + + public function toArray() { + $result = array(); + foreach($this->columns as $col) { + $result[$col] = $this->$col; + } + return $result; + } + + public function toUpdatableArray() { + $result = array(); + foreach($this->updatable_columns as $col) { + $result[$col] = $this->$col; + } + return $result; + } + + public function toPrimaryArray() { + $result = array(); + foreach($this->primary_columns as $col) { + $result[$col] = $this->$col; + } + return $result; + } +} diff --git a/vendor/zf2biz/Custom/autoload_classmap.php b/vendor/zf2biz/Custom/autoload_classmap.php new file mode 100644 index 0000000..e7ebc58 --- /dev/null +++ b/vendor/zf2biz/Custom/autoload_classmap.php @@ -0,0 +1,5 @@ + __DIR__ . '/Model/Entity.php', +);