ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMDTaxonPath Class Reference
+ Inheritance diagram for ilMDTaxonPath:
+ Collaboration diagram for ilMDTaxonPath:

Public Member Functions

getTaxonIds ()
 
getTaxon ($a_taxon_id)
 
addTaxon ()
 
 setSource ($a_source)
 
 getSource ()
 
 setSourceLanguage (&$lng_obj)
 
getSourceLanguage ()
 
 getSourceLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
getTaxonIds ()
 
getTaxon ($a_taxon_id)
 
addTaxon ()
 
 setSource ($a_source)
 
 getSource ()
 
 setSourceLanguage (&$lng_obj)
 
getSourceLanguage ()
 
 getSourceLanguageCode ()
 
 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.ilMDTaxonPath.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDTaxonPath::__getFields ( )

Definition at line 140 of file class.ilMDTaxonPath.php.

141 {
142 return array('rbac_id' => array('integer',$this->getRBACId()),
143 'obj_id' => array('integer',$this->getObjId()),
144 'obj_type' => array('text',$this->getObjType()),
145 'parent_type' => array('text',$this->getParentType()),
146 'parent_id' => array('integer',$this->getParentId()),
147 'source' => array('text',$this->getSource()),
148 'source_language' => array('text',$this->getSourceLanguageCode()));
149 }

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getSource(), and getSourceLanguageCode().

Referenced by save().

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

◆ __getFields() [2/2]

ilMDTaxonPath::__getFields ( )

Definition at line 142 of file class.ilMDTaxonPath.php.

143 {
144 return array('rbac_id' => $this->getRBACId(),
145 'obj_id' => $this->getObjId(),
146 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
147 'parent_type' => $this->getParentType(),
148 'parent_id' => $this->getParentId(),
149 'source' => ilUtil::prepareDBString($this->getSource()),
150 'source_language' => ilUtil::prepareDBString($this->getSourceLanguageCode()));
151 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getSource(), getSourceLanguageCode(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

Definition at line 210 of file class.ilMDTaxonPath.php.

211 {
212 global $ilDB;
213
214 $query = "SELECT meta_taxon_path_id FROM il_meta_taxon_path " .
215 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
216 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
217 "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
218 "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
219
220 $res = $ilDB->query($query);
221 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
222 $ids[] = $row->meta_taxon_path_id;
223 }
224 return $ids ? $ids : array();
225 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB

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

Referenced by ilMDClassification\getTaxonPathIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

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

Definition at line 200 of file class.ilMDTaxonPath.php.

201 {
202 global $ilDB;
203
204 $query = "SELECT meta_taxon_path_id FROM il_meta_taxon_path " .
205 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
206 "AND obj_id = " . $ilDB->quote($a_obj_id) . " " .
207 "AND parent_id = " . $ilDB->quote($a_parent_id) . " " .
208 "AND parent_type = " . $ilDB->quote($a_parent_type);
209
210 $res = $ilDB->query($query);
211 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
212 $ids[] = $row->meta_taxon_path_id;
213 }
214 return $ids ? $ids : array();
215 }

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

◆ addTaxon() [1/2]

& ilMDTaxonPath::addTaxon ( )

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

55 {
56 include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
57
58 $tax = new ilMDTaxon($this->getRBACId(), $this->getObjId(), $this->getObjType());
59 $tax->setParentId($this->getMetaId());
60 $tax->setParentType('meta_taxon_path');
61
62 return $tax;
63 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ addTaxon() [2/2]

& ilMDTaxonPath::addTaxon ( )

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

55 {
56 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
57
58 $tax = new ilMDTaxon($this->getRBACId(), $this->getObjId(), $this->getObjType());
59 $tax->setParentId($this->getMetaId());
60 $tax->setParentType('meta_taxon_path');
61
62 return $tax;
63 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDTaxonPath::delete ( )

Reimplemented from ilMDBase.

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

121 {
122 global $ilDB;
123
124 if ($this->getMetaId()) {
125 $query = "DELETE FROM il_meta_taxon_path " .
126 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId(), 'integer');
127 $res = $ilDB->manipulate($query);
128
129 foreach ($this->getTaxonIds() as $id) {
130 $tax = $this->getTaxon($id);
131 $tax->delete();
132 }
133
134 return true;
135 }
136 return false;
137 }
& getTaxon($a_taxon_id)
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, $ilDB, $query, $res, ilMDBase\getMetaId(), getTaxon(), and getTaxonIds().

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDTaxonPath::delete ( )

Reimplemented from ilMDBase.

Definition at line 121 of file class.ilMDTaxonPath.php.

122 {
123 global $ilDB;
124
125 if ($this->getMetaId()) {
126 $query = "DELETE FROM il_meta_taxon_path " .
127 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId());
128
129 $this->db->query($query);
130
131 foreach ($this->getTaxonIds() as $id) {
132 $tax = $this->getTaxon($id);
133 $tax->delete();
134 }
135
136 return true;
137 }
138 return false;
139 }

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

+ Here is the call graph for this function:

◆ getSource() [1/2]

ilMDTaxonPath::getSource ( )

Definition at line 70 of file class.ilMDTaxonPath.php.

71 {
72 return $this->source;
73 }
$source
Definition: linkback.php:22

References $source.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getSource() [2/2]

ilMDTaxonPath::getSource ( )

Definition at line 70 of file class.ilMDTaxonPath.php.

71 {
72 return $this->source;
73 }

References $source.

◆ getSourceLanguage() [1/2]

& ilMDTaxonPath::getSourceLanguage ( )

Definition at line 80 of file class.ilMDTaxonPath.php.

81 {
82 return is_object($this->source_language) ? $this->source_language : false;
83 }

◆ getSourceLanguage() [2/2]

& ilMDTaxonPath::getSourceLanguage ( )

Definition at line 80 of file class.ilMDTaxonPath.php.

81 {
82 return is_object($this->source_language) ? $this->source_language : false;
83 }

◆ getSourceLanguageCode() [1/2]

ilMDTaxonPath::getSourceLanguageCode ( )

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

85 {
86 return is_object($this->source_language) ? $this->source_language->getLanguageCode() : false;
87 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getSourceLanguageCode() [2/2]

ilMDTaxonPath::getSourceLanguageCode ( )

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

85 {
86 return is_object($this->source_language) ? $this->source_language->getLanguageCode() : false;
87 }

◆ getTaxon() [1/2]

& ilMDTaxonPath::getTaxon (   $a_taxon_id)

Definition at line 42 of file class.ilMDTaxonPath.php.

43 {
44 include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
45
46 if (!$a_taxon_id) {
47 return false;
48 }
49 $tax = new ilMDTaxon();
50 $tax->setMetaId($a_taxon_id);
51
52 return $tax;
53 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxon() [2/2]

& ilMDTaxonPath::getTaxon (   $a_taxon_id)

Definition at line 42 of file class.ilMDTaxonPath.php.

43 {
44 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
45
46 if (!$a_taxon_id) {
47 return false;
48 }
49 $tax = new ilMDTaxon();
50 $tax->setMetaId($a_taxon_id);
51
52 return $tax;
53 }

◆ getTaxonIds() [1/2]

& ilMDTaxonPath::getTaxonIds ( )

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

37 {
38 include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
39
40 return ilMDTaxon::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_taxon_path');
41 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMDTaxon\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

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

◆ getTaxonIds() [2/2]

& ilMDTaxonPath::getTaxonIds ( )

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

37 {
38 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
39
40 return ilMDTaxon::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_taxon_path');
41 }

References ilMDTaxon\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ read() [1/2]

ilMDTaxonPath::read ( )

Definition at line 151 of file class.ilMDTaxonPath.php.

152 {
153 global $ilDB;
154
155 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
156
157 if ($this->getMetaId()) {
158 $query = "SELECT * FROM il_meta_taxon_path " .
159 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId(), 'integer');
160
161 $res = $ilDB->query($query);
162 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163 $this->setRBACId($row->rbac_id);
164 $this->setObjId($row->obj_id);
165 $this->setObjType($row->obj_type);
166 $this->setParentId($row->parent_id);
167 $this->setParentType($row->parent_type);
168 $this->setSource($row->source);
169 $this->source_language = new ilMDLanguageItem($row->source_language);
170 }
171 }
172 return true;
173 }
setObjId($a_id)
setParentId($a_id)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDTaxonPath::read ( )

Definition at line 153 of file class.ilMDTaxonPath.php.

154 {
155 global $ilDB;
156
157 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
158
159 if ($this->getMetaId()) {
160 $query = "SELECT * FROM il_meta_taxon_path " .
161 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId());
162
163 $res = $this->db->query($query);
164 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
165 $this->setRBACId($row->rbac_id);
166 $this->setObjId($row->obj_id);
167 $this->setObjType($row->obj_type);
168 $this->setParentId($row->parent_id);
169 $this->setParentType($row->parent_type);
170 $this->setSource(ilUtil::stripSlashes($row->source));
171 $this->source_language = new ilMDLanguageItem($row->source_language);
172 }
173 }
174 return true;
175 }
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(), setSource(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDTaxonPath::save ( )

Reimplemented from ilMDBase.

Definition at line 90 of file class.ilMDTaxonPath.php.

91 {
92 global $ilDB;
93
94 $fields = $this->__getFields();
95 $fields['meta_taxon_path_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_taxon_path'));
96
97 if ($this->db->insert('il_meta_taxon_path', $fields)) {
98 $this->setMetaId($next_id);
99 return $this->getMetaId();
100 }
101 return false;
102 }
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]

ilMDTaxonPath::save ( )

Reimplemented from ilMDBase.

Definition at line 90 of file class.ilMDTaxonPath.php.

91 {
92 if ($this->db->autoExecute(
93 'il_meta_taxon_path',
94 $this->__getFields(),
96 )) {
97 $this->setMetaId($this->db->getLastInsertId());
98
99 return $this->getMetaId();
100 }
101 return false;
102 }

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

+ Here is the call graph for this function:

◆ setSource() [1/2]

ilMDTaxonPath::setSource (   $a_source)

Definition at line 66 of file class.ilMDTaxonPath.php.

67 {
68 $this->source = $a_source;
69 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setSource() [2/2]

ilMDTaxonPath::setSource (   $a_source)

Definition at line 66 of file class.ilMDTaxonPath.php.

67 {
68 $this->source = $a_source;
69 }

◆ setSourceLanguage() [1/2]

ilMDTaxonPath::setSourceLanguage ( $lng_obj)

Definition at line 74 of file class.ilMDTaxonPath.php.

75 {
76 if (is_object($lng_obj)) {
77 $this->source_language = $lng_obj;
78 }
79 }

◆ setSourceLanguage() [2/2]

ilMDTaxonPath::setSourceLanguage ( $lng_obj)

Definition at line 74 of file class.ilMDTaxonPath.php.

75 {
76 if (is_object($lng_obj)) {
77 $this->source_language = $lng_obj;
78 }
79 }

◆ toXML() [1/2]

ilMDTaxonPath::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 180 of file class.ilMDTaxonPath.php.

181 {
182 $writer->xmlStartTag('TaxonPath');
183
184 $writer->xmlElement(
185 'Source',
186 array('Language' => $this->getSourceLanguageCode()
187 ? $this->getSourceLanguageCode()
188 : 'en'),
189 $this->getSource()
190 );
191
192 // Taxon
193 $taxs = $this->getTaxonIds();
194 foreach ($taxs as $id) {
195 $tax =&$this->getTaxon($id);
196 $tax->toXML($writer);
197 }
198 if (!count($taxs)) {
199 include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
200 $tax = new ilMDTaxon($this->getRBACId(), $this->getObjId());
201 $tax->toXML($writer);
202 }
203
204 $writer->xmlEndTag('TaxonPath');
205 }

References $id, ilMDBase\getObjId(), ilMDBase\getRBACId(), getSource(), getSourceLanguageCode(), getTaxon(), and getTaxonIds().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDTaxonPath::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 182 of file class.ilMDTaxonPath.php.

183 {
184 $writer->xmlStartTag('TaxonPath');
185
186 $writer->xmlElement('Source', array('Language' => $this->getSourceLanguageCode()), $this->getSource());
187
188 // Taxon
189 foreach ($this->getTaxonIds() as $id) {
190 $tax =&$this->getTaxon($id);
191 $tax->toXML($writer);
192 }
193
194 $writer->xmlEndTag('TaxonPath');
195 }

References $id, getSource(), getSourceLanguageCode(), getTaxon(), and getTaxonIds().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDTaxonPath::update ( )

Reimplemented from ilMDBase.

Definition at line 104 of file class.ilMDTaxonPath.php.

105 {
106 global $ilDB;
107
108 if ($this->getMetaId()) {
109 if ($this->db->update(
110 'il_meta_taxon_path',
111 $this->__getFields(),
112 array("meta_taxon_path_id" => array('integer',$this->getMetaId()))
113 )) {
114 return true;
115 }
116 }
117 return false;
118 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDTaxonPath::update ( )

Reimplemented from ilMDBase.

Definition at line 104 of file class.ilMDTaxonPath.php.

105 {
106 global $ilDB;
107
108 if ($this->getMetaId()) {
109 if ($this->db->autoExecute(
110 'il_meta_taxon_path',
111 $this->__getFields(),
113 "meta_taxon_path_id = " . $ilDB->quote($this->getMetaId())
114 )) {
115 return true;
116 }
117 }
118 return false;
119 }

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: