This commit is contained in:
cgfhtw
2022-11-29 08:48:50 +01:00
parent 546e55ed96
commit 266ba7523f
21 changed files with 1863 additions and 0 deletions
@@ -11,4 +11,32 @@ class Contentsprache_model extends DB_Model
$this->dbTable = 'campus.tbl_contentsprache';
$this->pk = 'contentsprache_id';
}
/**
* Prueft ob der Content in der angegeben Sprache vorhanden ist
*
* @param int $content_id
* @param string $sprache
* @param int | null $version (optional)
* @param boolean | null $sichtbar (optional)
* @return stdClass
*/
public function exists($content_id, $sprache, $version=null, $sichtbar=null)
{
$condition = ['content_id' => $content_id, 'sprache' => $sprache];
if ($version)
$condition['version'] = $version;
if ($sichtbar !== null)
$condition['sichtbar'] = $sichtbar;
$result = $this->loadWhere($condition);
if (isError($result))
return $result;
return success(!!getData($result));
}
}