From 1d8dc5f8f0a8510e71a99d11f4b09d6dbb970e8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Thu, 15 Nov 2012 12:43:45 +0100 Subject: [PATCH] Corrections sur Custom\Model, Entity et Manager --- vendor/zf2biz/Custom/Model/Entity.php | 2 +- vendor/zf2biz/Custom/Model/Manager.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/zf2biz/Custom/Model/Entity.php b/vendor/zf2biz/Custom/Model/Entity.php index 7788491..25f334d 100644 --- a/vendor/zf2biz/Custom/Model/Entity.php +++ b/vendor/zf2biz/Custom/Model/Entity.php @@ -4,7 +4,7 @@ namespace Custom\Model; class Entity { - public function exchangeArray($data, $overwrite=true) + public function exchangeArray($data, $overwrite=false) { foreach($this->columns as $col) { if (array_key_exists($col, $data)) { diff --git a/vendor/zf2biz/Custom/Model/Manager.php b/vendor/zf2biz/Custom/Model/Manager.php index e7ae619..c615e66 100644 --- a/vendor/zf2biz/Custom/Model/Manager.php +++ b/vendor/zf2biz/Custom/Model/Manager.php @@ -89,11 +89,11 @@ abstract class Manager extends AbstractTableGateway public function save(Entity $entity) { - if ($this->is_new()) { + if ($this->is_new($entity)) { $this->insert( $entity->toUpdatableArray() ); - } elseif ($this->getGalerie(extract_primary($entity))) { + } elseif ($this->any($this->extract_primary($entity))) { $this->update( $entity->toUpdatableArray(), $entity->toPrimaryArray() -- 1.7.10.4