From 3a8463aa368c12c7f159de91e11c3046c2ab783e Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Tue, 6 Nov 2012 16:57:09 +0100 Subject: [PATCH] =?utf8?q?Rajout=20d'une=20biblioth=C3=A8que=20Custom?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- vendor/zf2biz/Custom/Model/Entity.php | 41 ++++++++++++++++++++++++++++ vendor/zf2biz/Custom/autoload_classmap.php | 5 ++++ 2 files changed, 46 insertions(+) create mode 100644 vendor/zf2biz/Custom/Model/Entity.php create mode 100644 vendor/zf2biz/Custom/autoload_classmap.php 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', +); -- 1.7.10.4