function update($data) { foreach ($this->findAll() as $row) { $newValue = $data[$row->name]; $tmp = explode('_', $row->name); if ($tmp[0] == 'pick') { $newValue = $newValue == 'on' ? 1 : 0; } parent::update(array('configId' => $row->configId, 'value' => $newValue)); } }