3 namespace Galerie\Model;
15 protected $columns = array(
24 protected $updatable_columns = array(
32 protected $primary_columns = array(
36 public function exchangeArray($data, $overwrite=true)
38 foreach($this->columns as $col) {
39 if (array_key_exists($col, $data)) {
40 $this->$col = $data[$col];
41 } elseif ($overwrite) {
47 public function toArray() {
49 foreach($this->columns as $col) {
50 $result[$col] = $this->$col;
55 public function toUpdatableArray() {
57 foreach($this->updatable_columns as $col) {
58 $result[$col] = $this->$col;
63 public function toPrimaryArray() {
65 foreach($this->primary_columns as $col) {
66 $result[$col] = $this->$col;