當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfValidatorBase::__construct方法代碼示例

本文整理匯總了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);
 }
開發者ID:Phennim,項目名稱:symfony1,代碼行數:27,代碼來源:sfValidatorSchema.class.php

示例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);
 }
開發者ID:cuongnv540,項目名稱:jobeet,代碼行數:32,代碼來源:sfValidatorOr.class.php

示例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);
 }
開發者ID:WIZARDISHUNGRY,項目名稱:symfony,代碼行數:35,代碼來源:sfValidatorAnd.class.php

示例4: __construct

 public function __construct($options = array(), $messages = array())
 {
     $this->addRequiredOption(self::OPTION_WIDGET);
     parent::__construct($options, $messages);
 }
開發者ID:uniteddiversity,項目名稱:policat,代碼行數:5,代碼來源:ValidatorWidget2Owner.class.php

示例5: __construct

 public function __construct($options = array(), $messages = array())
 {
     $this->addOption('value', null);
     parent::__construct($options, $messages);
 }
開發者ID:solutema,項目名稱:siwapp-sf1,代碼行數:5,代碼來源:CompareValueValidator.class.php

示例6: __construct

 public function __construct(\Doctrine\ORM\EntityManager $em, $options = array(), $messages = array())
 {
     $this->em = $em;
     parent::__construct($options, $messages);
 }
開發者ID:blt04,項目名稱:sfDoctrine2Plugin,代碼行數:5,代碼來源:sfValidatorDoctrineChoice.class.php

示例7: __construct

 public function __construct($options = array(), $messages = array())
 {
     parent::__construct($options, $messages);
 }
開發者ID:jfesquet,項目名稱:tempos,代碼行數:4,代碼來源:sfReservationOverlapValidator.class.php

示例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");
 }
開發者ID:uniteddiversity,項目名稱:policat,代碼行數:6,代碼來源:ValidatorFreeId.class.php

示例9: __construct

 public function __construct($options = array(), $messages = array())
 {
     parent::__construct($options, $messages);
     $this->_apiConection = new eSitefApi();
 }
開發者ID:seven07ve,項目名稱:vendorepuestos,代碼行數:5,代碼來源:sfValidatorPagoESite.php


注:本文中的sfValidatorBase::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。