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(); }