eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::countContentObjectsInSection PHP Method

countContentObjectsInSection() public method

Counts the number of content objects assigned to section with $id.
    public function countContentObjectsInSection($id)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query->select($query->alias($query->expr->count($this->dbHandler->quoteColumn('id')), 'content_count'))->from($this->dbHandler->quoteTable('ezcontentobject'))->where($query->expr->eq($this->dbHandler->quoteColumn('section_id'), $query->bindValue($id, null, \PDO::PARAM_INT)));
        $statement = $query->prepare();
        $statement->execute();
        return (int) $statement->fetchColumn();
    }