/** * Initialize this validator. * * @param sfContext $context The current application context. * @param array $parameters An associative array of initialization parameters. * * @return bool true, if initialization completes successfully, otherwise false. */ public function initialize($context, $parameters = null) { // initialize parent parent::initialize($context); $this->getParameterHolder()->add($parameters); // check parameters if (!$this->getParameter('column1')) { throw new sfValidatorException('The "column1" parameter is mandatory for the sfPropelUniqueRelationValidator validator.'); } if (!$this->getParameter('column2')) { throw new sfValidatorException('The "column2" parameter is mandatory for the sfPropelUniqueRelationValidator validator.'); } return true; }