/** * Called before the form is generated * * Sets up a default rule for content tables so there are no * identical headlines * * @see NController::preGenerateForm(); * @access public * @return null */ function preGenerateForm() { $model =& $this->getDefaultModel(); $fields = $model->fields(); if (in_array('cms_headline', $fields)) { $model->form_rules[] = array('cms_headline', 'This headline is already being used', 'callback', array(&$this, 'uniqueHeadline')); } parent::preGenerateForm(); }