public function getUserRelationRules()
    {
        $rules = [];
        if ($this->relationType == static::$relationMutual) {
            $rules = [
                [[$this->mutualTypeAttribute], 'in', 'range' => array_keys(static::$mutualTypes)],
                [[$this->mutualTypeAttribute], 'default', 'value' => static::$mutualTypeNormal],
            ];
        }
        return array_merge($rules, $this->getRemarkRules(),
            $this->getFavoriteRules(),
            $this->getGroupsRules(),
        $this->getOtherGuidRules());
    }
public function getUserRelationRules()
    {
        $rules = [];
        if ($this->relationType == static::$relationMutual) {
            $rules = [
                [[$this->mutualTypeAttribute], 'in', 'range' => array_keys(static::$mutualTypes)],
                [[$this->mutualTypeAttribute], 'default', 'value' => static::$mutualTypeNormal],
            ];
        }
        return array_merge($rules, $this->getRemarkRules(),
            $this->getFavoriteRules(),
            $this->getGroupsRules(),
        $this->getOtherGuidRules());
    }
public function getUserRelationRules ( ) { $ rules = [ ] ; if ( $ this -> relationType == static :: $ relationMutual ) { $ rules = [ [ [ $ this -> mutualTypeAttribute ] , 'in' , 'range' => array_keys ( static :: $ mutualTypes ) ] , [ [ $ this -> mutualTypeAttribute ] , 'default' , 'value' => static :: $ mutualTypeNormal ] , ] ; } return array_merge ( $ rules , $ this -> getRemarkRules ( ) , $ this -> getFavoriteRules ( ) , $ this -> getGroupsRules ( ) , $ this -> getOtherGuidRules ( ) ) ; }
Validation rules associated with user relation.
@return array rules.
Validation rules associated with user relation .