ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMD5295Taxon Class Reference
+ Inheritance diagram for ilMD5295Taxon:
+ Collaboration diagram for ilMD5295Taxon:

Public Member Functions

 setTaxon ($a_taxon)
 
 getTaxon ()
 
 setTaxonLanguage (&$lng_obj)
 
getTaxonLanguage ()
 
 getTaxonLanguageCode ()
 
 setTaxonId ($a_taxon_id)
 
 getTaxonId ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- Public Member Functions inherited from ilMD5295Base
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 setExportMode ($a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 

Additional Inherited Members

- Data Fields inherited from ilMD5295Base
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMD5295Base
 $log
 

Detailed Description

Definition at line 33 of file class.ilMD5295Taxon.php.

Member Function Documentation

◆ __getFields()

ilMD5295Taxon::__getFields ( )

Definition at line 120 of file class.ilMD5295Taxon.php.

References ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), ilMD5295Base\getParentId(), ilMD5295Base\getParentType(), ilMD5295Base\getRBACId(), getTaxon(), getTaxonId(), and getTaxonLanguageCode().

Referenced by save().

121  {
122  return array('rbac_id' => array('integer',$this->getRBACId()),
123  'obj_id' => array('integer',$this->getObjId()),
124  'obj_type' => array('text',$this->getObjType()),
125  'parent_type' => array('text',$this->getParentType()),
126  'parent_id' => array('integer',$this->getParentId()),
127  'taxon' => array('text',$this->getTaxon()),
128  'taxon_language' => array('text',$this->getTaxonLanguageCode()),
129  'taxon_id' => array('text',$this->getTaxonId()));
130  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds()

static ilMD5295Taxon::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)
static

Definition at line 179 of file class.ilMD5295Taxon.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMD5295TaxonPath\getTaxonIds().

180  {
181  global $DIC;
182 
183  $ilDB = $DIC['ilDB'];
184 
185  $query = "SELECT meta_taxon_id FROM il_meta_taxon " .
186  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
187  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
188  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
189  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
190 
191 
192  $res = $ilDB->query($query);
193  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
194  $ids[] = $row->meta_taxon_id;
195  }
196  return $ids ? $ids : array();
197  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the caller graph for this function:

◆ delete()

ilMD5295Taxon::delete ( )

Definition at line 102 of file class.ilMD5295Taxon.php.

References $DIC, $ilDB, $query, and ilMD5295Base\getMetaId().

103  {
104  global $DIC;
105 
106  $ilDB = $DIC['ilDB'];
107 
108  if ($this->getMetaId()) {
109  $query = "DELETE FROM il_meta_taxon " .
110  "WHERE meta_taxon_id = " . $ilDB->quote($this->getMetaId(), 'integer');
111 
112  $this->db->query($query);
113 
114  return true;
115  }
116  return false;
117  }
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ getTaxon()

ilMD5295Taxon::getTaxon ( )

Definition at line 40 of file class.ilMD5295Taxon.php.

Referenced by __getFields(), and toXML().

41  {
42  return $this->taxon;
43  }
+ Here is the caller graph for this function:

◆ getTaxonId()

ilMD5295Taxon::getTaxonId ( )

Definition at line 62 of file class.ilMD5295Taxon.php.

Referenced by __getFields(), and toXML().

63  {
64  return $this->taxon_id;
65  }
+ Here is the caller graph for this function:

◆ getTaxonLanguage()

& ilMD5295Taxon::getTaxonLanguage ( )

Definition at line 50 of file class.ilMD5295Taxon.php.

51  {
52  return is_object($this->taxon_language) ? $this->taxon_language : false;
53  }

◆ getTaxonLanguageCode()

ilMD5295Taxon::getTaxonLanguageCode ( )

Definition at line 54 of file class.ilMD5295Taxon.php.

Referenced by __getFields(), and toXML().

55  {
56  return is_object($this->taxon_language) ? $this->taxon_language->getLanguageCode() : false;
57  }
+ Here is the caller graph for this function:

◆ read()

ilMD5295Taxon::read ( )

Definition at line 132 of file class.ilMD5295Taxon.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMD5295Base\getMetaId(), ilMD5295Base\setObjId(), ilMD5295Base\setObjType(), ilMD5295Base\setParentId(), ilMD5295Base\setParentType(), ilMD5295Base\setRBACId(), setTaxon(), and setTaxonId().

133  {
134  global $DIC;
135 
136  $ilDB = $DIC['ilDB'];
137 
138  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
139 
140  if ($this->getMetaId()) {
141  $query = "SELECT * FROM il_meta_taxon " .
142  "WHERE meta_taxon_id = " . $ilDB->quote($this->getMetaId(), 'integer');
143 
144  $res = $this->db->query($query);
145  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
146  $this->setRBACId($row->rbac_id);
147  $this->setObjId($row->obj_id);
148  $this->setObjType($row->obj_type);
149  $this->setParentId($row->parent_id);
150  $this->setParentType($row->parent_type);
151  $this->setTaxon($row->taxon);
152  $this->taxon_language = new ilMD5295LanguageItem($row->taxon_language);
153  $this->setTaxonId($row->taxon_id);
154  }
155  }
156  return true;
157  }
setParentType($a_parent_type)
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
setTaxonId($a_taxon_id)
+ Here is the call graph for this function:

◆ save()

ilMD5295Taxon::save ( )

Definition at line 68 of file class.ilMD5295Taxon.php.

References $DIC, $ilDB, __getFields(), ilMD5295Base\getMetaId(), and ilMD5295Base\setMetaId().

69  {
70  global $DIC;
71 
72  $ilDB = $DIC['ilDB'];
73 
74  $fields = $this->__getFields();
75  $fields['meta_taxon_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_taxon'));
76 
77  if ($this->db->insert('il_meta_taxon', $fields)) {
78  $this->setMetaId($next_id);
79  return $this->getMetaId();
80  }
81  return false;
82  }
global $DIC
Definition: goto.php:24
global $ilDB
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setTaxon()

ilMD5295Taxon::setTaxon (   $a_taxon)

Definition at line 36 of file class.ilMD5295Taxon.php.

Referenced by read().

37  {
38  $this->taxon = $a_taxon;
39  }
+ Here is the caller graph for this function:

◆ setTaxonId()

ilMD5295Taxon::setTaxonId (   $a_taxon_id)

Definition at line 58 of file class.ilMD5295Taxon.php.

Referenced by read().

59  {
60  $this->taxon_id = $a_taxon_id;
61  }
+ Here is the caller graph for this function:

◆ setTaxonLanguage()

ilMD5295Taxon::setTaxonLanguage ( $lng_obj)

Definition at line 44 of file class.ilMD5295Taxon.php.

45  {
46  if (is_object($lng_obj)) {
47  $this->taxon_language = $lng_obj;
48  }
49  }

◆ toXML()

ilMD5295Taxon::toXML ( $writer)

Definition at line 164 of file class.ilMD5295Taxon.php.

References getTaxon(), getTaxonId(), and getTaxonLanguageCode().

165  {
166  $writer->xmlElement(
167  'Taxon',
168  array('Language' => $this->getTaxonLanguageCode()
169  ? $this->getTaxonLanguageCode()
170  : 'en',
171  'Id' => $this->getTaxonId() ?
172  $this->getTaxonId() : ("ID" . rand())),
173  $this->getTaxon()
174  );
175  }
+ Here is the call graph for this function:

◆ update()

ilMD5295Taxon::update ( )

Definition at line 84 of file class.ilMD5295Taxon.php.

References $DIC, $ilDB, and ilMD5295Base\getMetaId().

85  {
86  global $DIC;
87 
88  $ilDB = $DIC['ilDB'];
89 
90  if ($this->getMetaId()) {
91  if ($this->db->update(
92  'il_meta_taxon',
93  $this->__getFields(),
94  array("meta_taxon_id" => array('integer',$this->getMetaId()))
95  )) {
96  return true;
97  }
98  }
99  return false;
100  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: