public function findByWorkspaceAndSearch(
        Workspace $workspace,
        $search = '',
        $orderedBy = 'id',
        $order = 'ASC'
    ) {
        $dql = "
            SELECT r FROM Claroline\CoreBundle\Entity\Role r
            JOIN r.workspace ws
            WHERE ws.id = :workspaceId
            AND UPPER(r.translationKey) LIKE :search
            ORDER BY r.{$orderedBy} {$order}
        ";
        $query = $this->_em->createQuery($dql);
        $query->setParameter('workspaceId', $workspace->getId());
        $upperSearch = strtoupper($search);
        $query->setParameter('search', "%{$upperSearch}%");

        return $query->getResult();
    }
public function findByWorkspaceAndSearch(
        Workspace $workspace,
        $search = '',
        $orderedBy = 'id',
        $order = 'ASC'
    ) {
        $dql = "
            SELECT r FROM Claroline\CoreBundle\Entity\Role r
            JOIN r.workspace ws
            WHERE ws.id = :workspaceId
            AND UPPER(r.translationKey) LIKE :search
            ORDER BY r.{$orderedBy} {$order}
        ";
        $query = $this->_em->createQuery($dql);
        $query->setParameter('workspaceId', $workspace->getId());
        $upperSearch = strtoupper($search);
        $query->setParameter('search', "%{$upperSearch}%");

        return $query->getResult();
    }
public function findByWorkspaceAndSearch ( Workspace $ workspace , $ search = '' , $ orderedBy = 'id' , $ order = 'ASC' ) { $ dql = "
            SELECT r FROM Claroline\CoreBundle\Entity\Role r
            JOIN r.workspace ws
            WHERE ws.id = :workspaceId
            AND UPPER(r.translationKey) LIKE :search
            ORDER BY r.{$orderedBy} {$order}
        " ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameter ( 'workspaceId' , $ workspace -> getId ( ) ) ; $ upperSearch = strtoupper ( $ search ) ; $ query -> setParameter ( 'search' , "%{$upperSearch}%" ) ; return $ query -> getResult ( ) ; }
Returns the searched roles associated to a workspace.

@param Workspace $workspace

@return array[Workspace]
Returns the searched roles associated to a workspace .