protected function collectRelations(array $flat)
    {

        $relations = [];

        foreach ($flat as $key=>$value) {

            if ($relation = $this->getRelationName($key)) {
                $relations[] = $relation;
            }

        }

        return array_values(array_unique($relations));

    }
protected function collectRelations(array $flat)
    {

        $relations = [];

        foreach ($flat as $key=>$value) {

            if ($relation = $this->getRelationName($key)) {
                $relations[] = $relation;
            }

        }

        return array_values(array_unique($relations));

    }
protected function collectRelations ( array $ flat ) { $ relations = [ ] ; foreach ( $ flat as $ key => $ value ) { if ( $ relation = $ this -> getRelationName ( $ key ) ) { $ relations [ ] = $ relation ; } } return array_values ( array_unique ( $ relations ) ) ; }
Collects all relation keys

@param array $rules

@return array
Collects all relation keys