protected function findRelationByName($relationName)
    {
        foreach ($this->relations as $relation) {
            if ($relation->name() == $relationName || $relation->entity() == $relationName) {
                return $relation;
            }
        }

        return null;
    }
protected function findRelationByName($relationName)
    {
        foreach ($this->relations as $relation) {
            if ($relation->name() == $relationName || $relation->entity() == $relationName) {
                return $relation;
            }
        }

        return null;
    }
protected function findRelationByName ( $ relationName ) { foreach ( $ this -> relations as $ relation ) { if ( $ relation -> name ( ) == $ relationName || $ relation -> entity ( ) == $ relationName ) { return $ relation ; } } return null ; }
Finds relation by its name

@param string $relationName

@return RelationInterface
Finds relation by its name