Inheritance: extends AbstractController
Example #1
0
 function setSource(\Model $m, $data)
 {
     // Calculate sub-child count
     foreach ($data as &$row) {
         $row[$this->field . '_cnt'] = count($row[$this->field]);
     }
     parent::setSource($m, $data);
 }
Example #2
0
 function setSource($m, $s)
 {
     $d = array();
     foreach ($s as $key => $val) {
         $d[$key] = array('name' => $val, 'id' => $key);
     }
     return parent::setSource($m, $d);
 }
Example #3
0
 function setSource($model, $data)
 {
     $newdata = array();
     foreach ($data as $id => $name) {
         $newdata[] = array('id' => $id, 'name' => $name);
     }
     return parent::setSource($model, $newdata);
 }