public static function addRelationship($query, $relationship)
    {
        $property = $query->getRepository()->getDescription()->getProperty($relationship);

        switch (true) {
            case $property->isManyToOne() :
                return self::_parseManyToOne($query, $property);
            case $property->isManyToMany() :
                return self::_parseManyToMany($query, $property);
            case $property->isOneToMany() :
                return self::_parseOneToMany($query, $property);

        }
    }
public static function addRelationship($query, $relationship)
    {
        $property = $query->getRepository()->getDescription()->getProperty($relationship);

        switch (true) {
            case $property->isManyToOne() :
                return self::_parseManyToOne($query, $property);
            case $property->isManyToMany() :
                return self::_parseManyToMany($query, $property);
            case $property->isOneToMany() :
                return self::_parseOneToMany($query, $property);

        }
    }
public static function addRelationship ( $ query , $ relationship ) { $ property = $ query -> getRepository ( ) -> getDescription ( ) -> getProperty ( $ relationship ) ; switch ( true ) { case $ property -> isManyToOne ( ) : return self :: _parseManyToOne ( $ query , $ property ) ; case $ property -> isManyToMany ( ) : return self :: _parseManyToMany ( $ query , $ property ) ; case $ property -> isOneToMany ( ) : return self :: _parseOneToMany ( $ query , $ property ) ; } }
Adds a relationship to query.

@param AnDomainQuery $query        Query Object
@param string        $relationship Relationship name
Adds a relationship to query .