public function countLocationsByContentId($contentId) { $q = $this->handler->createSelectQuery(); $q->select($q->alias($q->expr->count('*'), 'count'))->from($this->handler->quoteTable('ezcontentobject_tree'))->where($q->expr->eq($this->handler->quoteColumn('contentobject_id'), $q->bindValue($contentId, null, \PDO::PARAM_INT))); $stmt = $q->prepare(); $stmt->execute(); $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); return (int) $res[0]['count']; }