2 namespace Custom\Model;
7 public function exchangeArray($data, $overwrite=true)
9 foreach($this->columns as $col) {
10 if (array_key_exists($col, $data)) {
11 $this->$col = $data[$col];
12 } elseif ($overwrite) {
18 public function toArray() {
20 foreach($this->columns as $col) {
21 $result[$col] = $this->$col;
26 public function toUpdatableArray() {
28 foreach($this->updatable_columns as $col) {
29 $result[$col] = $this->$col;
34 public function toPrimaryArray() {
36 foreach($this->primary_columns as $col) {
37 $result[$col] = $this->$col;