@param mixed $validate

@return $this
347665
public function setValidate(\chilimatic\lib\route\validator\AbstractValidator $validate)
    {
        $this->validate = $validate;

        return $this;
    }
386640
public function setHit($hit)
    {
        if (false === is_bool($hit)) {
            throw InvalidArgumentException::typeMismatch($hit, 'Boolean');
        }

        $this->hit = $hit;

        return $this;
    }
530798
public function addResource(array $resources, $validate = false)
    {
        $response = $this->getUser()->post(
            'source/resource/add',
            array('id' => $this->getId(), 'resources' => $resources, 'validate' => $validate)
        );

        $this->resources = $response['resources'];
    }
655815
public function setValidations(ArrayObject $validations) {
        foreach ($validations as $param => $validation) {
            $this->setValidation($param, $validation);
        }
        return $this;
    }
1033976
protected function setValidations($modelData)
    {
        $fields = '';
        $firstIteration = true;

        foreach ($modelData->fields as $field)
        {
            if ($firstIteration)
            {
                $fields .= sprintf("'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
                $firstIteration = false;
            }
            else
            {
                $fields .= sprintf($this->tab(3) . "'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
            }
        }

        $this->stub = str_replace('{{validations}}', $fields, $this->stub);

        return $this;
    }
1317910
public function addRule()
    {
        foreach ($this->rules as $field => $rule) {
            $this->validation->addRule($field, $rule);
        }

        return $this;
    }
696386
public function format($date, $format = 'iso8601', $validate = true)
    {
        $result = null;
        try {
            if ($validate) {
                $format = $this->validateFormat($format);
            }
            $result = $this->parse($date)->format($format);
        } catch (\Exception $e) {
        }

        return $result;
    }
29100
protected function _setValue($property, $value, $validate = true)
    {
        if ($this->_propertyExists($property)) {
            if ($validate) {
                self::$_manager->validateAttribute($this, $property, ['maxLength','readOnly'], $value);
            }
            if ($this->_propertyTypeAllowed($property, $value)) {
                $this->{$property} = $value;
            } else {
                $this->{$property} = $this->tryFormat($value, $this->_getPropertyType($property), $property);
            }
        } else {
            if ($this->_getDynamicAttributeDenied()) {
                throw new \Exception('Dynamic attribute: ' . $property . ' not allowed for entity ' . get_class($this));
            }
            $this->{$property} = $value;
        }
    }
18623
public function setValue($value)
    {
        if ($this->validation && !$this->validates($value)) {
            throw new Invalid($this->getValidationMessage($value));
        }

        if ($this->isMultiple()) {
            $this->value = $this->value === null ? [ $value ] : array_merge($this->value, [ $value ]);
        } else {
            $this->value = $value;
        }

        return $this;
    }
298744
public static function makePath( $validate = true, $forceCreate = false )
    {
        $_arguments = func_get_args();
        $_validate = $_path = null;

        foreach ( $_arguments as $_part )
        {
            if ( is_bool( $_part ) )
            {
                $_validate = $_part;
                continue;
            }

            $_path .= DIRECTORY_SEPARATOR . trim( $_part, DIRECTORY_SEPARATOR . ' ' );
        }

        if ( !is_dir( $_path = realpath( $_path ) ) )
        {
            if ( $_validate && !$forceCreate )
            {
                return false;
            }

            if ( $forceCreate )
            {
                if ( false === @mkdir( $_path, 0, true ) )
                {
                    throw new UtilityException( 'The result path "' . $_path . '" could not be created.' );
                }
            }
        }

        return $_path;
    }
1168522
public function storeValues($validate = true)
    {
        $this->populateFormOnce();
        $container = $this->getController()->getSessionContainer();
        $id        = $this->form->getId();

        $container->storeValues($id, (array)$this->form->getValue());
        if ($validate) {
            $container->storeValidationStatus($id, $this->form->validate());
        }
        return $container->getValidationStatus($id);
    }
406577
public function validator($validator, $condition = true)
    {
        if (!$condition) {
            return $this;
        }

        if ($validator instanceof \Closure) {
            $this->validators[] = $validator;
        } else {
            $this->rule($validator);
        }

        return $this;
    }
161624
public function addValidator($validator)
    {
        if (!($validator instanceof ValidatorInterface) && !is_callable($validator)) {
            $validator = ValidatorHelper::create($validator);
        }

        $this->validator->addValidator($validator);

        return $this;
    }
142742
public function add(\Caridea\Validate\Rule ...$rules): self
    {
        $this->rules = array_merge($this->rules, $rules);
        return $this;
    }
1075733
public function item($item = NULL, $validate = array() ){
    // проверим данные на существование
    if( $item === NULL )                { return NULL; }
    if( !is_array($validate) )          { return NULL; }
    if( !isset($validate['type']) )     { return NULL; }
    if( !is_string($validate['type']) ) { return NULL; }
    if(!isset($this->reformMethods[ $validate['type'] ])){ return NULL; }
    //
    $ValidateClassName = $this->reformMethods[ $validate['type'] ];
    $useClass = new $ValidateClassName();
    // проверим реализует ли класс наш интерфейс
    if ( !($useClass instanceof \Oploshka\Reform\ReformItemInterface ) ) { return NULL; }
  
    $_validate = $validate['validate'] ?? [];
    return $useClass::validate($item, $_validate, $this);
  }
99906
public function addValidationError($errorMessage)
    {
        if (is_string($errorMessage)) {
            $this->validationErrors[] = $errorMessage;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($errorMessage). "' for argument 'errorMessage' given."
            );
        }

        return $this;
    }
1340806
public function addValidator(Validator\ValidatorInterface $validator) {
        $this->validators[get_class($validator)] = $validator;
        
        return $this;
    }