コード例 #1
0
 /**
  * Validate element value
  *
  * If a translation adapter is registered, any error messages will be
  * translated according to the current locale, using the given error code;
  * if no matching translation is found, the original message will be
  * utilized.
  *
  * Note: The *filtered* value is validated.
  *
  * @param  array   $data
  * @param  mixed   $context
  * @return boolean
  */
 public function isValid($data, $context = null, $removeNotPresentFields = false)
 {
     if (!$data instanceof \Application\Model\Sim\CustomFieldsModel) {
         $this->_messages = array();
         $this->_messages[self::NOT_CUSTOM_FIELDS] = $this->_messageCustomFields[self::NOT_CUSTOM_FIELDS];
         return false;
     }
     return parent::isValid($data, $context, $removeNotPresentFields);
 }
コード例 #2
0
 /**
  * Validate element value
  *
  * If a translation adapter is registered, any error messages will be
  * translated according to the current locale, using the given error code;
  * if no matching translation is found, the original message will be
  * utilized.
  *
  * Note: The *filtered* value is validated.
  *
  * @param  array   $data
  * @param  mixed   $context
  * @return boolean
  */
 public function isValid($data, $context = null, $removeNotPresentFields = false)
 {
     if (!($data instanceof \Application\Model\Sim\LocationModel || is_array($data))) {
         $this->_messages = array();
         $this->_messages[self::NOT_LOCATION] = $this->_messageLocation[self::NOT_LOCATION];
         return false;
     }
     //TODO Check validations for each type
     return parent::isValid($data, $context, $removeNotPresentFields);
 }
コード例 #3
0
 public function __construct($options = null)
 {
     $this->_spec = array('validators' => array('voice' => array('Restriction\\Commercial\\VoiceSmsRestrictionValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true)), 'sms' => array('Restriction\\Commercial\\VoiceSmsRestrictionValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true)), 'data' => array('HasSameValues' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true))));
     parent::__construct($options);
 }
コード例 #4
0
 public function __construct($options = null)
 {
     $this->_spec = array('validators' => array('adjusts' => array('Array' => array('prefixPath' => array("\\Application\\Model\\Validate\\" => APPLICATION_PATH . "/modules/default/models/Validate/"), 'validators' => array('PreBill\\AdjustValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true)))), 'discounts' => array('PreBill\\UpdatedDiscountsValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true)), 'taxes' => array('PreBill\\TaxesListValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true)), 'customCharges' => array('Array' => array('prefixPath' => array("\\Application\\Model\\Validate\\" => APPLICATION_PATH . "/modules/default/models/Validate/"), 'validators' => array('PreBill\\CustomChargeValidate' => array('breakChainOnFailure' => true, 'acceptArrayAsModel' => true))))));
     parent::__construct($options);
 }
コード例 #5
0
 public function __construct($options = null)
 {
     $this->_spec = array('validators' => array('name' => array('NotEmpty' => array('breakChainOnFailure' => true), 'StringLength' => array('max' => 64, 'encoding' => "UTF-8", 'breakChainOnFailure' => true)), 'value' => array('NotEmpty' => array('breakChainOnFailure' => true), 'PercentFalseDecimals' => array('breakChainOnFailure' => true))));
     parent::__construct($options);
 }