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); }
function setSource($m, $s) { $d = array(); foreach ($s as $key => $val) { $d[$key] = array('name' => $val, 'id' => $key); } return parent::setSource($m, $d); }
function setSource($model, $data) { $newdata = array(); foreach ($data as $id => $name) { $newdata[] = array('id' => $id, 'name' => $name); } return parent::setSource($model, $newdata); }