eZ\Publish\Core\Persistence\Legacy\Tests\Content\Gateway\DoctrineDatabaseTest::countContentNames PHP Method

countContentNames() protected method

Counts the number of content names.
protected countContentNames ( integer $contentId = null ) : integer
$contentId integer
return integer
    protected function countContentNames($contentId = null)
    {
        $query = $this->getDatabaseHandler()->createSelectQuery();
        $query->select('count(*)')->from('ezcontentobject_name');
        if ($contentId !== null) {
            $query->where('contentobject_id=' . $contentId);
        }
        $statement = $query->prepare();
        $statement->execute();
        return (int) $statement->fetchColumn();
    }
DoctrineDatabaseTest