19 declare(strict_types=1);
34 public function setTaxon(
string $a_taxon): void
36 $this->taxon = $a_taxon;
46 $this->taxon_language = $lng_obj;
51 return is_object($this->taxon_language) ? $this->taxon_language :
null;
56 return is_object($this->taxon_language) ? $this->taxon_language->getLanguageCode() :
'';
61 $this->taxon_id = $a_taxon_id;
72 $fields[
'meta_taxon_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_taxon'));
74 if ($this->db->insert(
'il_meta_taxon', $fields)) {
83 return $this->
getMetaId() && $this->db->update(
86 array(
"meta_taxon_id" => array(
'integer', $this->
getMetaId()))
90 public function delete():
bool 93 $query =
"DELETE FROM il_meta_taxon " .
94 "WHERE meta_taxon_id = " . $this->db->quote($this->
getMetaId(),
'integer');
96 $this->db->query($query);
109 'rbac_id' => array(
'integer', $this->
getRBACId()),
110 'obj_id' => array(
'integer', $this->
getObjId()),
111 'obj_type' => array(
'text', $this->
getObjType()),
113 'parent_id' => array(
'integer', $this->
getParentId()),
114 'taxon' => array(
'text', $this->
getTaxon()),
116 'taxon_id' => array(
'text', $this->
getTaxonId())
123 $query =
"SELECT * FROM il_meta_taxon " .
124 "WHERE meta_taxon_id = " . $this->db->quote($this->
getMetaId(),
'integer');
126 $res = $this->db->query($query);
129 $this->
setObjId((
int) $row->obj_id);
143 $random = new \Random\Randomizer();
148 'Id' => $this->
getTaxonId() ?: (
"ID" . $random->nextInt())
159 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
163 $ilDB = $DIC->database();
165 $query =
"SELECT meta_taxon_id FROM il_meta_taxon " .
166 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
167 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
168 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
169 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
174 $ids[] = (
int) $row->meta_taxon_id;
ilMDLanguageItem $taxon_language
setTaxonId(string $a_taxon_id)
setTaxonLanguage(ilMDLanguageItem $lng_obj)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
setTaxon(string $a_taxon)
toXML(ilXmlWriter $writer)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setParentType(string $a_parent_type)
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setMetaId(int $a_meta_id, bool $a_read_data=true)
setObjType(string $a_type)