mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
s&d
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user