protected function getVisibleOnlySubQuery(SelectQuery $query)
    {
        // TODO: The following query requires optimization
        $subSelect = $query->subSelect();
        $subSelect
            ->selectDistinct('ezurl_object_link.url_id')
            ->from('ezurl_object_link')
            ->innerJoin(
                'ezcontentobject_attribute',
                $query->expr->lAnd(
                    $query->expr->eq('ezurl_object_link.contentobject_attribute_id', 'ezcontentobject_attribute.id'),
                    $query->expr->eq('ezurl_object_link.contentobject_attribute_version', 'ezcontentobject_attribute.version')
                )
            )
            ->innerJoin(
                'ezcontentobject_tree',
                $query->expr->lAnd(
                    $query->expr->eq('ezcontentobject_tree.contentobject_id', 'ezcontentobject_attribute.contentobject_id'),
                    $query->expr->eq('ezcontentobject_tree.contentobject_version', 'ezcontentobject_attribute.version')
                )
            )
            ->where(
                $query->expr->eq(
                    'ezcontentobject_tree.is_invisible',
                    $query->bindValue(0, null, PDO::PARAM_INT)
                )
            );

        return $subSelect;
    }
protected function getVisibleOnlySubQuery(SelectQuery $query)
    {
        // TODO: The following query requires optimization
        $subSelect = $query->subSelect();
        $subSelect
            ->selectDistinct('ezurl_object_link.url_id')
            ->from('ezurl_object_link')
            ->innerJoin(
                'ezcontentobject_attribute',
                $query->expr->lAnd(
                    $query->expr->eq('ezurl_object_link.contentobject_attribute_id', 'ezcontentobject_attribute.id'),
                    $query->expr->eq('ezurl_object_link.contentobject_attribute_version', 'ezcontentobject_attribute.version')
                )
            )
            ->innerJoin(
                'ezcontentobject_tree',
                $query->expr->lAnd(
                    $query->expr->eq('ezcontentobject_tree.contentobject_id', 'ezcontentobject_attribute.contentobject_id'),
                    $query->expr->eq('ezcontentobject_tree.contentobject_version', 'ezcontentobject_attribute.version')
                )
            )
            ->where(
                $query->expr->eq(
                    'ezcontentobject_tree.is_invisible',
                    $query->bindValue(0, null, PDO::PARAM_INT)
                )
            );

        return $subSelect;
    }
protected function getVisibleOnlySubQuery ( SelectQuery $ query ) { // TODO: The following query requires optimization $ subSelect = $ query -> subSelect ( ) ; $ subSelect -> selectDistinct ( 'ezurl_object_link.url_id' ) -> from ( 'ezurl_object_link' ) -> innerJoin ( 'ezcontentobject_attribute' , $ query -> expr -> lAnd ( $ query -> expr -> eq ( 'ezurl_object_link.contentobject_attribute_id' , 'ezcontentobject_attribute.id' ) , $ query -> expr -> eq ( 'ezurl_object_link.contentobject_attribute_version' , 'ezcontentobject_attribute.version' ) ) ) -> innerJoin ( 'ezcontentobject_tree' , $ query -> expr -> lAnd ( $ query -> expr -> eq ( 'ezcontentobject_tree.contentobject_id' , 'ezcontentobject_attribute.contentobject_id' ) , $ query -> expr -> eq ( 'ezcontentobject_tree.contentobject_version' , 'ezcontentobject_attribute.version' ) ) ) -> where ( $ query -> expr -> eq ( 'ezcontentobject_tree.is_invisible' , $ query -> bindValue ( 0 , null , PDO :: PARAM_INT ) ) ) ; return $ subSelect ; }
Generate query that selects ids of visible URLs.

@param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
@return \eZ\Publish\Core\Persistence\Database\SelectQuery
Generate query that selects ids of visible URLs .