private function createConversationQueryBuilder()
    {
        return $this->objectManager->createQueryBuilder()
            ->select('c', 'cp', 'p', 't', 'm', 'mp')
            ->from($this->getConversationClass(), 'c')
            ->leftJoin('c.persons', 'cp')
            ->leftJoin('cp.person', 'p')
            ->leftJoin('cp.tags', 't')
            ->leftJoin('c.messages', 'm')
            ->leftJoin('m.persons', 'mp')
            ->orderBy('m.date', 'ASC')
            ->addOrderBy('m.id', 'ASC');
    }
private function createConversationQueryBuilder()
    {
        return $this->objectManager->createQueryBuilder()
            ->select('c', 'cp', 'p', 't', 'm', 'mp')
            ->from($this->getConversationClass(), 'c')
            ->leftJoin('c.persons', 'cp')
            ->leftJoin('cp.person', 'p')
            ->leftJoin('cp.tags', 't')
            ->leftJoin('c.messages', 'm')
            ->leftJoin('m.persons', 'mp')
            ->orderBy('m.date', 'ASC')
            ->addOrderBy('m.id', 'ASC');
    }
private function createConversationQueryBuilder ( ) { return $ this -> objectManager -> createQueryBuilder ( ) -> select ( 'c' , 'cp' , 'p' , 't' , 'm' , 'mp' ) -> from ( $ this -> getConversationClass ( ) , 'c' ) -> leftJoin ( 'c.persons' , 'cp' ) -> leftJoin ( 'cp.person' , 'p' ) -> leftJoin ( 'cp.tags' , 't' ) -> leftJoin ( 'c.messages' , 'm' ) -> leftJoin ( 'm.persons' , 'mp' ) -> orderBy ( 'm.date' , 'ASC' ) -> addOrderBy ( 'm.id' , 'ASC' ) ; }
Create a conversation query builder with optimized joins.

@return \Doctrine\ORM\QueryBuilder
Create a conversation query builder with optimized joins .