Allow to remove all fields of a form except a given list:
public function unsetAllExcept($fields = array()) { foreach($this->getObject()->toArray(BasePeer::TYPE_FIELDNAME) as $key => $val) { $tmp[] = strtolower($key); } $tmp = array_diff($tmp, $fields); foreach($tmp as $value) { unset($this[$value]); } }
Remove created_at, updated_at ...
$this->unsetAllExcept(array('comment'));
$form_ajax_options = $sf_data->get('form_ajax_options', ESC_RAW);
$security = $this->getSecurityConfiguration();
logs
8052.8 KB