示例#1
0
 public function __construct(Container $container, $params)
 {
     if (isset($params[0])) {
         $this->minValue = $params[0];
     }
     if (isset($params[1])) {
         $this->maxValue = $params[1];
     }
     if (isset($params[2])) {
         $this->inclusive = $params[2];
     }
     parent::__construct($container, $params);
     //        $paramValidation = new OneOf(new Numeric(), new NullType());
     //        if (!$paramValidation->validate($min)) {
     //            throw new ComponentException(
     //                sprintf('%s is not a valid numeric length', $min)
     //            );
     //        }
     //
     //        if (!$paramValidation->validate($max)) {
     //            throw new ComponentException(
     //                sprintf('%s is not a valid numeric length', $max)
     //            );
     //        }
     //
     //        if (!is_null($min) && !is_null($max) && $min > $max) {
     //            throw new ComponentException(
     //                sprintf('%s cannot be less than %s for validation', $min, $max)
     //            );
     //        }
 }
 public function setName($name)
 {
     parent::setName($name);
     if ($this->Validation instanceof ValidationInterface) {
         $this->Validation->setName($name);
     }
     return $this;
 }
 public function setName($name)
 {
     $parentName = $this->getName();
     foreach ($this->rules as $rule) {
         $ruleName = $rule->getName();
         if ($ruleName && $parentName !== $ruleName) {
             continue;
         }
         $rule->setName($name);
     }
     return parent::setName($name);
 }
示例#4
0
 public function setName($name)
 {
     $this->rule->setName($name);
     return parent::setName($name);
 }
 public function setName($name)
 {
     $this->getValidationInterface()->setName($name);
     return parent::setName($name);
 }