lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php
public function getRuleCount(int $ruleStatus, ?Layout $layout = null): int
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('count(*) AS count')
            ->from('ngbm_rule');

        if ($layout instanceof Layout) {
            $query->andWhere(
                $query->expr()->eq('layout_id', ':layout_id')
            )
            ->setParameter('layout_id', $layout->id, Type::INTEGER);
        }

        $this->applyStatusCondition($query, $ruleStatus);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return (int) ($data[0]['count'] ?? 0);
    }
public function getRuleCount(int $ruleStatus, ?Layout $layout = null): int
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('count(*) AS count')
            ->from('ngbm_rule');

        if ($layout instanceof Layout) {
            $query->andWhere(
                $query->expr()->eq('layout_id', ':layout_id')
            )
            ->setParameter('layout_id', $layout->id, Type::INTEGER);
        }

        $this->applyStatusCondition($query, $ruleStatus);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return (int) ($data[0]['count'] ?? 0);
    }
public function getRuleCount ( int $ ruleStatus , ? Layout $ layout = null ) : int { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( 'count(*) AS count' ) -> from ( 'ngbm_rule' ) ; if ( $ layout instanceof Layout ) { $ query -> andWhere ( $ query -> expr ( ) -> eq ( 'layout_id' , ':layout_id' ) ) -> setParameter ( 'layout_id' , $ layout -> id , Type :: INTEGER ) ; } $ this -> applyStatusCondition ( $ query , $ ruleStatus ) ; $ data = $ query -> execute ( ) -> fetchAll ( PDO :: FETCH_ASSOC ) ; return ( int ) ( $ data [ 0 ] [ 'count' ] ?? 0 ) ; }
Returns the number of rules.
Returns the number of rules .