ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMD5295TaxonPath Class Reference
+ Inheritance diagram for ilMD5295TaxonPath:
+ Collaboration diagram for ilMD5295TaxonPath:

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)
 
- 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.ilMD5295TaxonPath.php.

Member Function Documentation

◆ __getFields()

ilMD5295TaxonPath::__getFields ( )

Definition at line 146 of file class.ilMD5295TaxonPath.php.

147 {
148 return array('rbac_id' => array('integer',$this->getRBACId()),
149 'obj_id' => array('integer',$this->getObjId()),
150 'obj_type' => array('text',$this->getObjType()),
151 'parent_type' => array('text',$this->getParentType()),
152 'parent_id' => array('integer',$this->getParentId()),
153 'source' => array('text',$this->getSource()),
154 'source_language' => array('text',$this->getSourceLanguageCode()));
155 }

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

Referenced by save().

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

◆ _getIds()

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

Definition at line 218 of file class.ilMD5295TaxonPath.php.

219 {
220 global $DIC;
221
222 $ilDB = $DIC['ilDB'];
223
224 $query = "SELECT meta_taxon_path_id FROM il_meta_taxon_path " .
225 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
226 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
227 "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
228 "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
229
230 $res = $ilDB->query($query);
231 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
232 $ids[] = $row->meta_taxon_path_id;
233 }
234 return $ids ? $ids : array();
235 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB
$DIC
Definition: xapitoken.php:46

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

Referenced by ilMD5295Classification\getTaxonPathIds().

+ Here is the caller graph for this function:

◆ addTaxon()

& ilMD5295TaxonPath::addTaxon ( )

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

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

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

+ Here is the call graph for this function:

◆ delete()

ilMD5295TaxonPath::delete ( )

Reimplemented from ilMD5295Base.

Definition at line 124 of file class.ilMD5295TaxonPath.php.

125 {
126 global $DIC;
127
128 $ilDB = $DIC['ilDB'];
129
130 if ($this->getMetaId()) {
131 $query = "DELETE FROM il_meta_taxon_path " .
132 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId(), 'integer');
133 $res = $ilDB->manipulate($query);
134
135 foreach ($this->getTaxonIds() as $id) {
136 $tax = $this->getTaxon($id);
137 $tax->delete();
138 }
139
140 return true;
141 }
142 return false;
143 }

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

+ Here is the call graph for this function:

◆ getSource()

ilMD5295TaxonPath::getSource ( )

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

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

References $source.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getSourceLanguage()

& ilMD5295TaxonPath::getSourceLanguage ( )

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

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

◆ getSourceLanguageCode()

ilMD5295TaxonPath::getSourceLanguageCode ( )

Definition at line 84 of file class.ilMD5295TaxonPath.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:

◆ getTaxon()

& ilMD5295TaxonPath::getTaxon (   $a_taxon_id)

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

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

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxonIds()

& ilMD5295TaxonPath::getTaxonIds ( )

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

37 {
38 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php';
39
40 return ilMD5295Taxon::_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 ilMD5295Taxon\_getIds(), ilMD5295Base\getMetaId(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

Referenced by delete(), and toXML().

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

◆ read()

ilMD5295TaxonPath::read ( )

Definition at line 157 of file class.ilMD5295TaxonPath.php.

158 {
159 global $DIC;
160
161 $ilDB = $DIC['ilDB'];
162
163 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
164
165 if ($this->getMetaId()) {
166 $query = "SELECT * FROM il_meta_taxon_path " .
167 "WHERE meta_taxon_path_id = " . $ilDB->quote($this->getMetaId(), 'integer');
168
169 $res = $ilDB->query($query);
170 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
171 $this->setRBACId($row->rbac_id);
172 $this->setObjId($row->obj_id);
173 $this->setObjType($row->obj_type);
174 $this->setParentId($row->parent_id);
175 $this->setParentType($row->parent_type);
176 $this->setSource($row->source);
177 $this->source_language = new ilMD5295LanguageItem($row->source_language);
178 }
179 }
180 return true;
181 }
setParentType($a_parent_type)

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

+ Here is the call graph for this function:

◆ save()

ilMD5295TaxonPath::save ( )

Reimplemented from ilMD5295Base.

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

91 {
92 global $DIC;
93
94 $ilDB = $DIC['ilDB'];
95
96 $fields = $this->__getFields();
97 $fields['meta_taxon_path_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_taxon_path'));
98
99 if ($this->db->insert('il_meta_taxon_path', $fields)) {
100 $this->setMetaId($next_id);
101 return $this->getMetaId();
102 }
103 return false;
104 }
setMetaId($a_meta_id, $a_read_data=true)

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

+ Here is the call graph for this function:

◆ setSource()

ilMD5295TaxonPath::setSource (   $a_source)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setSourceLanguage()

ilMD5295TaxonPath::setSourceLanguage ( $lng_obj)

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

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

◆ toXML()

ilMD5295TaxonPath::toXML ( $writer)

Reimplemented from ilMD5295Base.

Definition at line 188 of file class.ilMD5295TaxonPath.php.

189 {
190 $writer->xmlStartTag('TaxonPath');
191
192 $writer->xmlElement(
193 'Source',
194 array('Language' => $this->getSourceLanguageCode()
195 ? $this->getSourceLanguageCode()
196 : 'en'),
197 $this->getSource()
198 );
199
200 // Taxon
201 $taxs = $this->getTaxonIds();
202 foreach ($taxs as $id) {
203 $tax = &$this->getTaxon($id);
204 $tax->toXML($writer);
205 }
206 if (!count($taxs)) {
207 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php';
208 $tax = new ilMD5295Taxon($this->getRBACId(), $this->getObjId());
209 $tax->toXML($writer);
210 }
211
212 $writer->xmlEndTag('TaxonPath');
213 }

References ilMD5295Base\getObjId(), ilMD5295Base\getRBACId(), getSource(), getSourceLanguageCode(), getTaxon(), and getTaxonIds().

+ Here is the call graph for this function:

◆ update()

ilMD5295TaxonPath::update ( )

Reimplemented from ilMD5295Base.

Definition at line 106 of file class.ilMD5295TaxonPath.php.

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

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

+ Here is the call graph for this function:

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