public getContentCount ( mixed $stateId ) : integer | ||
$stateId | mixed | |
return | integer |
public function getContentCount($stateId)
{
$query = $this->dbHandler->createSelectQuery();
$query->select($query->alias($query->expr->count('*'), 'count'))->from($this->dbHandler->quoteTable('ezcobj_state_link'))->where($query->expr->eq($this->dbHandler->quoteColumn('contentobject_state_id'), $query->bindValue($stateId, null, \PDO::PARAM_INT)));
$statement = $query->prepare();
$statement->execute();
$count = $statement->fetchColumn();
return $count !== null ? (int) $count : 0;
}