本文整理汇总了PHP中sfValidatorBase::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP sfValidatorBase::__construct方法的具体用法?PHP sfValidatorBase::__construct怎么用?PHP sfValidatorBase::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfValidatorBase
的用法示例。
在下文中一共展示了sfValidatorBase::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* The first argument can be:
*
* * null
* * an array of named sfValidatorBase instances
*
* @param mixed $fields Initial fields
* @param array $options An array of options
* @param array $messages An array of error messages
*
* @see sfValidatorBase
*/
public function __construct($fields = null, $options = array(), $messages = array())
{
if (is_array($fields)) {
foreach ($fields as $name => $validator) {
$this[$name] = $validator;
}
} else {
if (null !== $fields) {
throw new InvalidArgumentException('sfValidatorSchema constructor takes an array of sfValidatorBase objects.');
}
}
parent::__construct($options, $messages);
}
示例2: __construct
/**
* Constructor.
*
* The first argument can be:
*
* * null
* * a sfValidatorBase instance
* * an array of sfValidatorBase instances
*
* @param mixed $validators Initial validators
* @param array $options An array of options
* @param array $messages An array of error messages
*
* @see sfValidatorBase
*/
public function __construct($validators = null, $options = array(), $messages = array())
{
if ($validators instanceof sfValidatorBase) {
$this->addValidator($validators);
} else {
if (is_array($validators)) {
foreach ($validators as $validator) {
$this->addValidator($validator);
}
} else {
if (null !== $validators) {
throw new InvalidArgumentException('sfValidatorOr constructor takes a sfValidatorBase object, or a sfValidatorBase array.');
}
}
}
parent::__construct($options, $messages);
}
示例3: __construct
/**
* Constructor.
*
* The first argument can be:
*
* * null
* * a sfValidatorBase instance
* * an array of sfValidatorBase instances
*
* @param mixed $validators Initial validators
* @param array $options An array of options
* @param array $messages An array of error messages
*
* @see sfValidatorBase
*/
public function __construct($validators = null, $options = array(), $messages = array())
{
if ($validators instanceof sfValidatorBase) {
$this->addValidator($validators);
} else {
if (is_array($validators)) {
foreach ($validators as $validator) {
$this->addValidator($validator);
}
} else {
if (!is_null($validators)) {
throw new InvalidArgumentException('sfValidatorAnd constructor takes a sfValidatorBase object, or a sfValidatorBase array.');
}
}
}
if (!isset($options['required'])) {
$options['required'] = false;
}
parent::__construct($options, $messages);
}
示例4: __construct
public function __construct($options = array(), $messages = array())
{
$this->addRequiredOption(self::OPTION_WIDGET);
parent::__construct($options, $messages);
}
示例5: __construct
public function __construct($options = array(), $messages = array())
{
$this->addOption('value', null);
parent::__construct($options, $messages);
}
示例6: __construct
public function __construct(\Doctrine\ORM\EntityManager $em, $options = array(), $messages = array())
{
$this->em = $em;
parent::__construct($options, $messages);
}
示例7: __construct
public function __construct($options = array(), $messages = array())
{
parent::__construct($options, $messages);
}
示例8: __construct
public function __construct($options = array(), $messages = array())
{
$this->addRequiredOption(self::OPTION_MODEL);
parent::__construct($options, $messages);
$this->addMessage('used', "Sorry ID already used");
}
示例9: __construct
public function __construct($options = array(), $messages = array())
{
parent::__construct($options, $messages);
$this->_apiConection = new eSitefApi();
}