public function countDisplayedToolsByWorkspace(
        Workspace $workspace,
        $orderedToolType = 0
    ) {
        $dql = "
            SELECT count(tool)
            FROM Claroline\CoreBundle\Entity\Tool\Tool tool
            JOIN tool.orderedTools ot
            JOIN ot.workspace ws
            LEFT JOIN tool.plugin p
            WHERE ws.id = {$workspace->getId()}
            AND ot.type = :type
            AND (
                CONCAT(p.vendorName, p.bundleName) IN (:bundles)
                OR tool.plugin is NULL
            )
        ";
        $query = $this->_em->createQuery($dql);
        $query->setParameter('type', $orderedToolType);
        $query->setParameter('bundles', $this->bundles);

        return $query->getSingleScalarResult();
    }
public function countDisplayedToolsByWorkspace(
        Workspace $workspace,
        $orderedToolType = 0
    ) {
        $dql = "
            SELECT count(tool)
            FROM Claroline\CoreBundle\Entity\Tool\Tool tool
            JOIN tool.orderedTools ot
            JOIN ot.workspace ws
            LEFT JOIN tool.plugin p
            WHERE ws.id = {$workspace->getId()}
            AND ot.type = :type
            AND (
                CONCAT(p.vendorName, p.bundleName) IN (:bundles)
                OR tool.plugin is NULL
            )
        ";
        $query = $this->_em->createQuery($dql);
        $query->setParameter('type', $orderedToolType);
        $query->setParameter('bundles', $this->bundles);

        return $query->getSingleScalarResult();
    }
public function countDisplayedToolsByWorkspace ( Workspace $ workspace , $ orderedToolType = 0 ) { $ dql = "
            SELECT count(tool)
            FROM Claroline\CoreBundle\Entity\Tool\Tool tool
            JOIN tool.orderedTools ot
            JOIN ot.workspace ws
            LEFT JOIN tool.plugin p
            WHERE ws.id = {$workspace->getId()}
            AND ot.type = :type
            AND (
                CONCAT(p.vendorName, p.bundleName) IN (:bundles)
                OR tool.plugin is NULL
            )
        " ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameter ( 'type' , $ orderedToolType ) ; $ query -> setParameter ( 'bundles' , $ this -> bundles ) ; return $ query -> getSingleScalarResult ( ) ; }
Returns the number of tools visible in a workspace.

@param Workspace $workspace

@return int
Returns the number of tools visible in a workspace .