コード例 #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);
 }