public function buildFindOppositeQuery(Node $a, Node $b) { $query = $this->getConn()->createQueryBuilder(); $query->select($b->getIdForEdge())->from($this->getTable())->orderBy('id', 'ASC'); $query->andWhere($a->getTable() . '_id' . ' = ' . $query->createNamedParameter($a->getId())); return $query; }