public static function exists($id, $activeOnly = true)
{
trigger_error('Backend\\Modules\\ContentBlocks\\Engine is deprecated.
Switch to doctrine instead.', E_USER_DEPRECATED);
$db = BackendModel::getContainer()->get('database');
// if the item should also be active, there should be at least one row to return true
if ((bool) $activeOnly) {
return (bool) $db->getVar('SELECT 1
FROM content_blocks AS i
WHERE i.id = ? AND i.status = ? AND i.language = ?
LIMIT 1', array((int) $id, 'active', BL::getWorkingLanguage()));
}
// fallback, this doesn't take the active status in account
return (bool) $db->getVar('SELECT 1
FROM content_blocks AS i
WHERE i.revision_id = ? AND i.language = ?
LIMIT 1', array((int) $id, BL::getWorkingLanguage()));
}