public function getLocationContentMainLanguageId($locationId)
{
$dbHandler = $this->dbHandler;
$query = $dbHandler->createSelectQuery();
$query->select($dbHandler->quoteColumn('initial_language_id', 'ezcontentobject'))->from($dbHandler->quoteTable('ezcontentobject'))->innerJoin($dbHandler->quoteTable('ezcontentobject_tree'), $query->expr->lAnd($query->expr->eq($dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_tree'), $dbHandler->quoteColumn('id', 'ezcontentobject')), $query->expr->eq($dbHandler->quoteColumn('node_id', 'ezcontentobject_tree'), $dbHandler->quoteColumn('main_node_id', 'ezcontentobject_tree')), $query->expr->eq($dbHandler->quoteColumn('node_id', 'ezcontentobject_tree'), $query->bindValue($locationId, null, \PDO::PARAM_INT))));
$statement = $query->prepare();
$statement->execute();
$languageId = $statement->fetchColumn();
if ($languageId === false) {
throw new RuntimeException("Could not find Content for Location #{$locationId}");
}
return $languageId;
}