From: Sébastien CHAZALLET Date: Thu, 15 Nov 2012 11:43:45 +0000 (+0100) Subject: Corrections sur Custom\Model, Entity et Manager X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=commitdiff_plain;h=1d8dc5f8f0a8510e71a99d11f4b09d6dbb970e8a Corrections sur Custom\Model, Entity et Manager --- 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()