Inheritance: use trait Webiny\Component\StdLib\SingletonTrait
Esempio n. 1
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     try {
         return $this->validation()->validate($data, 'minLength:' . $params[0]);
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }
Esempio n. 2
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     try {
         return $this->validation()->validate($data, 'creditCardNumber');
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }
Esempio n. 3
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     $params = is_string($params) ? $params : implode(':', $params);
     try {
         return $this->validation()->validate($data, 'in:' . $params);
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }