Utilisation de Custom pour GalerieC
authorSébastien CHAZALLET <s.chazallet@gmail.com>
Tue, 6 Nov 2012 16:02:18 +0000 (17:02 +0100)
committerSébastien CHAZALLET <s.chazallet@gmail.com>
Tue, 6 Nov 2012 16:02:18 +0000 (17:02 +0100)
module/Galerie/src/Galerie/Model/GalerieC.php

index dcf51c7..dceb108 100644 (file)
@@ -2,7 +2,9 @@
 
 namespace Galerie\Model;
 
-class GalerieC
+use Custom\Model\Entity;
+
+class GalerieC extends Entity
 {
     public $id;
     public $id_user;
@@ -33,39 +35,4 @@ class GalerieC
         'id',
     );
 
-    public function exchangeArray($data, $overwrite=true)
-    {
-        foreach($this->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;
-    }
-
 }