ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMDTaxon Class Reference
+ Inheritance diagram for ilMDTaxon:
+ Collaboration diagram for ilMDTaxon:

Public Member Functions

 setTaxon ($a_taxon)
 
 getTaxon ()
 
 setTaxonLanguage (&$lng_obj)
 
getTaxonLanguage ()
 
 getTaxonLanguageCode ()
 
 setTaxonId ($a_taxon_id)
 
 getTaxonId ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setTaxon ($a_taxon)
 
 getTaxon ()
 
 setTaxonLanguage (&$lng_obj)
 
getTaxonLanguage ()
 
 getTaxonLanguageCode ()
 
 setTaxonId ($a_taxon_id)
 
 getTaxonId ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
- Public Member Functions inherited from ilMDBase
 __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)
 
 __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 ()
 
 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 ilMDBase
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMDBase
 $log
 

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDTaxon::__getFields ( )

Definition at line 117 of file class.ilMDTaxon.php.

118 {
119 return array('rbac_id' => array('integer',$this->getRBACId()),
120 'obj_id' => array('integer',$this->getObjId()),
121 'obj_type' => array('text',$this->getObjType()),
122 'parent_type' => array('text',$this->getParentType()),
123 'parent_id' => array('integer',$this->getParentId()),
124 'taxon' => array('text',$this->getTaxon()),
125 'taxon_language' => array('text',$this->getTaxonLanguageCode()),
126 'taxon_id' => array('text',$this->getTaxonId()));
127 }

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

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDTaxon::__getFields ( )

Definition at line 114 of file class.ilMDTaxon.php.

115 {
116 return array('rbac_id' => $this->getRBACId(),
117 'obj_id' => $this->getObjId(),
118 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
119 'parent_type' => $this->getParentType(),
120 'parent_id' => $this->getParentId(),
121 'taxon' => ilUtil::prepareDBString($this->getTaxon()),
122 'taxon_language' => ilUtil::prepareDBString($this->getTaxonLanguageCode()),
123 'taxon_id' => ilUtil::prepareDBString($this->getTaxonId()));
124 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getTaxon(), getTaxonId(), getTaxonLanguageCode(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

Definition at line 173 of file class.ilMDTaxon.php.

174 {
175 global $ilDB;
176
177 $query = "SELECT meta_taxon_id FROM il_meta_taxon ".
178 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
179 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
180 "AND parent_id = ".$ilDB->quote($a_parent_id ,'integer')." ".
181 "AND parent_type = ".$ilDB->quote($a_parent_type ,'text');
182
183
184 $res = $ilDB->query($query);
185 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
186 {
187 $ids[] = $row->meta_taxon_id;
188 }
189 return $ids ? $ids : array();
190 }
global $ilDB

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

Referenced by ilMDTaxonPath\getTaxonIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDTaxon::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 166 of file class.ilMDTaxon.php.

167 {
168 global $ilDB;
169
170 $query = "SELECT meta_taxon_id FROM il_meta_taxon ".
171 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
172 "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
173 "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
174 "AND parent_type = ".$ilDB->quote($a_parent_type);
175
176
177 $res = $ilDB->query($query);
178 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
179 {
180 $ids[] = $row->meta_taxon_id;
181 }
182 return $ids ? $ids : array();
183 }

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

◆ delete() [1/2]

ilMDTaxon::delete ( )

Reimplemented from ilMDBase.

Definition at line 100 of file class.ilMDTaxon.php.

101 {
102 global $ilDB;
103
104 if($this->getMetaId())
105 {
106 $query = "DELETE FROM il_meta_taxon ".
107 "WHERE meta_taxon_id = ".$ilDB->quote($this->getMetaId() ,'integer');
108
109 $this->db->query($query);
110
111 return true;
112 }
113 return false;
114 }

References $ilDB, $query, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDTaxon::delete ( )

Reimplemented from ilMDBase.

Definition at line 99 of file class.ilMDTaxon.php.

100 {
101 if($this->getMetaId())
102 {
103 $query = "DELETE FROM il_meta_taxon ".
104 "WHERE meta_taxon_id = ".$ilDB->quote($this->getMetaId());
105
106 $this->db->query($query);
107
108 return true;
109 }
110 return false;
111 }

References $query, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ getTaxon() [1/2]

ilMDTaxon::getTaxon ( )

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

41 {
42 return $this->taxon;
43 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxon() [2/2]

ilMDTaxon::getTaxon ( )

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

41 {
42 return $this->taxon;
43 }

◆ getTaxonId() [1/2]

ilMDTaxon::getTaxonId ( )

Definition at line 63 of file class.ilMDTaxon.php.

64 {
65 return $this->taxon_id;
66 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxonId() [2/2]

ilMDTaxon::getTaxonId ( )

Definition at line 63 of file class.ilMDTaxon.php.

64 {
65 return $this->taxon_id;
66 }

◆ getTaxonLanguage() [1/2]

& ilMDTaxon::getTaxonLanguage ( )

Definition at line 51 of file class.ilMDTaxon.php.

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

◆ getTaxonLanguage() [2/2]

& ilMDTaxon::getTaxonLanguage ( )

Definition at line 51 of file class.ilMDTaxon.php.

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

◆ getTaxonLanguageCode() [1/2]

ilMDTaxon::getTaxonLanguageCode ( )

Definition at line 55 of file class.ilMDTaxon.php.

56 {
57 return is_object($this->taxon_language) ? $this->taxon_language->getLanguageCode() : false;
58 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxonLanguageCode() [2/2]

ilMDTaxon::getTaxonLanguageCode ( )

Definition at line 55 of file class.ilMDTaxon.php.

56 {
57 return is_object($this->taxon_language) ? $this->taxon_language->getLanguageCode() : false;
58 }

◆ read() [1/2]

ilMDTaxon::read ( )

Definition at line 129 of file class.ilMDTaxon.php.

130 {
131 global $ilDB;
132
133 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
134
135 if($this->getMetaId())
136 {
137 $query = "SELECT * FROM il_meta_taxon ".
138 "WHERE meta_taxon_id = ".$ilDB->quote($this->getMetaId() ,'integer');
139
140 $res = $this->db->query($query);
141 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
142 {
143 $this->setRBACId($row->rbac_id);
144 $this->setObjId($row->obj_id);
145 $this->setObjType($row->obj_type);
146 $this->setParentId($row->parent_id);
147 $this->setParentType($row->parent_type);
148 $this->setTaxon($row->taxon);
149 $this->taxon_language = new ilMDLanguageItem($row->taxon_language);
150 $this->setTaxonId($row->taxon_id);
151 }
152 }
153 return true;
154 }
setObjId($a_id)
setParentId($a_id)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)
setTaxonId($a_taxon_id)
setTaxon($a_taxon)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDTaxon::read ( )

Definition at line 126 of file class.ilMDTaxon.php.

127 {
128 global $ilDB;
129
130 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
131
132 if($this->getMetaId())
133 {
134 $query = "SELECT * FROM il_meta_taxon ".
135 "WHERE meta_taxon_id = ".$ilDB->quote($this->getMetaId());
136
137 $res = $this->db->query($query);
138 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
139 {
140 $this->setRBACId($row->rbac_id);
141 $this->setObjId($row->obj_id);
142 $this->setObjType($row->obj_type);
143 $this->setParentId($row->parent_id);
144 $this->setParentType($row->parent_type);
145 $this->setTaxon(ilUtil::stripSlashes($row->taxon));
146 $this->taxon_language = new ilMDLanguageItem($row->taxon_language);
147 $this->setTaxonId(ilUtil::stripSlashes($row->taxon_id));
148 }
149 }
150 return true;
151 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), ilMDBase\setRBACId(), setTaxon(), setTaxonId(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDTaxon::save ( )

Reimplemented from ilMDBase.

Definition at line 69 of file class.ilMDTaxon.php.

70 {
71 global $ilDB;
72
73 $fields = $this->__getFields();
74 $fields['meta_taxon_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_taxon'));
75
76 if($this->db->insert('il_meta_taxon',$fields))
77 {
78 $this->setMetaId($next_id);
79 return $this->getMetaId();
80 }
81 return false;
82 }
setMetaId($a_meta_id, $a_read_data=true)

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

+ Here is the call graph for this function:

◆ save() [2/2]

ilMDTaxon::save ( )

Reimplemented from ilMDBase.

Definition at line 69 of file class.ilMDTaxon.php.

70 {
71 if($this->db->autoExecute('il_meta_taxon',
72 $this->__getFields(),
74 {
75 $this->setMetaId($this->db->getLastInsertId());
76
77 return $this->getMetaId();
78 }
79 return false;
80 }

References ilMDBase\getMetaId(), ilDBConstants\MDB2_AUTOQUERY_INSERT, and ilMDBase\setMetaId().

+ Here is the call graph for this function:

◆ setTaxon() [1/2]

ilMDTaxon::setTaxon (   $a_taxon)

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

37 {
38 $this->taxon = $a_taxon;
39 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTaxon() [2/2]

ilMDTaxon::setTaxon (   $a_taxon)

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

37 {
38 $this->taxon = $a_taxon;
39 }

◆ setTaxonId() [1/2]

ilMDTaxon::setTaxonId (   $a_taxon_id)

Definition at line 59 of file class.ilMDTaxon.php.

60 {
61 $this->taxon_id = $a_taxon_id;
62 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTaxonId() [2/2]

ilMDTaxon::setTaxonId (   $a_taxon_id)

Definition at line 59 of file class.ilMDTaxon.php.

60 {
61 $this->taxon_id = $a_taxon_id;
62 }

◆ setTaxonLanguage() [1/2]

ilMDTaxon::setTaxonLanguage ( $lng_obj)

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

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

◆ setTaxonLanguage() [2/2]

ilMDTaxon::setTaxonLanguage ( $lng_obj)

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

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

◆ toXML() [1/2]

ilMDTaxon::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 161 of file class.ilMDTaxon.php.

162 {
163 $writer->xmlElement('Taxon',array('Language' => $this->getTaxonLanguageCode()
164 ? $this->getTaxonLanguageCode()
165 : 'en',
166 'Id' => $this->getTaxonId() ?
167 $this->getTaxonId() : ("ID".rand())),
168 $this->getTaxon());
169 }

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

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDTaxon::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 158 of file class.ilMDTaxon.php.

159 {
160 $writer->xmlElement('Taxon',array('Language' => $this->getTaxonLanguageCode(),
161 'Id' => $this->getTaxonId()),$this->getTaxon());
162 }

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

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDTaxon::update ( )

Reimplemented from ilMDBase.

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

85 {
86 global $ilDB;
87
88 if($this->getMetaId())
89 {
90 if($this->db->update('il_meta_taxon',
91 $this->__getFields(),
92 array("meta_taxon_id" => array('integer',$this->getMetaId()))))
93 {
94 return true;
95 }
96 }
97 return false;
98 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDTaxon::update ( )

Reimplemented from ilMDBase.

Definition at line 82 of file class.ilMDTaxon.php.

83 {
84 global $ilDB;
85
86 if($this->getMetaId())
87 {
88 if($this->db->autoExecute('il_meta_taxon',
89 $this->__getFields(),
91 "meta_taxon_id = ".$ilDB->quote($this->getMetaId())))
92 {
93 return true;
94 }
95 }
96 return false;
97 }

References $ilDB, ilMDBase\getMetaId(), and ilDBConstants\MDB2_AUTOQUERY_UPDATE.

+ Here is the call graph for this function:

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