Rajout de la gestion des paires pour les select
[zf2.biz/galerie.git] / vendor / zf2biz / Custom / Model / Pair.php
1 <?php
2
3 namespace Custom\Model;
4
5
6 class Pair
7 {
8     protected static $field_id = 'id';
9     protected static $field_name = 'name';
10
11     protected $id = null;
12     protected $name = null;
13
14     public function exchangeArray($data)
15     {
16         $this->id = $data[static::$field_id];
17         $this->name = $data[static::$field_name];
18     }
19
20     public function toArray() {
21         return array(
22             'id' => $this->id,
23             'name' => $this->name,
24         );
25     }
26
27     public function getArrayCopy() {
28         return array(
29             'id' => $this->id,
30             'name' => $this->name,
31         );
32     }
33
34 }