public function validateValue($value) {

        $model = &$this->_model;

        $attribute = $this->_attributeName;
        if ((!is_array($model->$attribute) || !count($model->$attribute)) && $this->skipOnEmpty) {
            return '';
        }

        $result = count($model->$attribute) > 0;
        $class = $this->baseModel;

        foreach ($model->$attribute as $_key => &$_model) {
            /** @var $_model Model|ActiveRecord */
            if (!is_object($_model)) {
                if (!is_array($_model)) {
                    $_model = [$this->attribute ? : $this->_attributeName => $_model];
                }
                $_model = new $class($_model);
            }

            $result = $_model->validate() && $result;
        }

        return $result || (sizeof($model->$attribute)==1 && $this->skipOnEmpty) ? null : [$this->message, $result];
    }
public function validateValue($value) {

        $model = &$this->_model;

        $attribute = $this->_attributeName;
        if ((!is_array($model->$attribute) || !count($model->$attribute)) && $this->skipOnEmpty) {
            return '';
        }

        $result = count($model->$attribute) > 0;
        $class = $this->baseModel;

        foreach ($model->$attribute as $_key => &$_model) {
            /** @var $_model Model|ActiveRecord */
            if (!is_object($_model)) {
                if (!is_array($_model)) {
                    $_model = [$this->attribute ? : $this->_attributeName => $_model];
                }
                $_model = new $class($_model);
            }

            $result = $_model->validate() && $result;
        }

        return $result || (sizeof($model->$attribute)==1 && $this->skipOnEmpty) ? null : [$this->message, $result];
    }
public function validateValue ( $ value ) { $ model = & $ this -> _model ; $ attribute = $ this -> _attributeName ; if ( ( ! is_array ( $ model -> $ attribute ) || ! count ( $ model -> $ attribute ) ) && $ this -> skipOnEmpty ) { return '' ; } $ result = count ( $ model -> $ attribute ) > 0 ; $ class = $ this -> baseModel ; foreach ( $ model -> $ attribute as $ _key => & $ _model ) { /** @var $_model Model|ActiveRecord */ if ( ! is_object ( $ _model ) ) { if ( ! is_array ( $ _model ) ) { $ _model = [ $ this -> attribute ? : $ this -> _attributeName => $ _model ] ; } $ _model = new $ class ( $ _model ) ; } $ result = $ _model -> validate ( ) && $ result ; } return $ result || ( sizeof ( $ model -> $ attribute ) == 1 && $ this -> skipOnEmpty ) ? null : [ $ this -> message , $ result ] ; }
Validates models array.
@param mixed $attribute the data value to be validated.
@return array|null the error message and the parameters to be inserted into the error message.
Null should be returned if the data is valid.
Validates models array .