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

Public Member Functions

 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 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.ilMDDescription.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDDescription::__getFields ( )

Definition at line 107 of file class.ilMDDescription.php.

108 {
109 return array('rbac_id' => array('integer',$this->getRBACId()),
110 'obj_id' => array('integer',$this->getObjId()),
111 'obj_type' => array('text',$this->getObjType()),
112 'parent_type' => array('text',$this->getParentType()),
113 'parent_id' => array('integer',$this->getParentId()),
114 'description' => array('clob',$this->getDescription()),
115 'description_language' => array('text',$this->getDescriptionLanguageCode()));
116 }

References getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

Referenced by save().

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

◆ __getFields() [2/2]

ilMDDescription::__getFields ( )

Definition at line 107 of file class.ilMDDescription.php.

108 {
109 return array('rbac_id' => $this->getRBACId(),
110 'obj_id' => $this->getObjId(),
111 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
112 'parent_type' => $this->getParentType(),
113 'parent_id' => $this->getParentId(),
114 'description' => ilUtil::prepareDBString($this->getDescription()),
115 'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
116 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

Definition at line 159 of file class.ilMDDescription.php.

160 {
161 global $ilDB;
162
163 $query = "SELECT meta_description_id FROM il_meta_description ".
164 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
165 "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
166 "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
167 "AND parent_type = ".$ilDB->quote($a_parent_type)." ".
168 "ORDER BY meta_description_id";
169
170 $res = $ilDB->query($query);
171 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
172 {
173 $ids[] = $row->meta_description_id;
174 }
175 return $ids ? $ids : array();
176 }
global $ilDB

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

Referenced by ilMDEducational\getDescriptionIds(), and ilMDGeneral\getDescriptionIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

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

Definition at line 156 of file class.ilMDDescription.php.

157 {
158 global $ilDB;
159
160 $query = "SELECT meta_description_id FROM il_meta_description ".
161 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
162 "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
163 "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
164 "AND parent_type = ".$ilDB->quote($a_parent_type)." ".
165 "ORDER BY meta_description_id";
166
167 $res = $ilDB->query($query);
168 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
169 {
170 $ids[] = $row->meta_description_id;
171 }
172 return $ids ? $ids : array();
173 }

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

◆ delete() [1/2]

ilMDDescription::delete ( )

Reimplemented from ilMDBase.

Definition at line 91 of file class.ilMDDescription.php.

92 {
93 global $ilDB;
94
95 if($this->getMetaId())
96 {
97 $query = "DELETE FROM il_meta_description ".
98 "WHERE meta_description_id = ".$ilDB->quote($this->getMetaId() ,'integer');
99 $res = $ilDB->manipulate($query);
100
101 return true;
102 }
103 return false;
104 }

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDDescription::delete ( )

Reimplemented from ilMDBase.

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

91 {
92 global $ilDB;
93
94 if($this->getMetaId())
95 {
96 $query = "DELETE FROM il_meta_description ".
97 "WHERE meta_description_id = ".$ilDB->quote($this->getMetaId());
98
99 $this->db->query($query);
100
101 return true;
102 }
103 return false;
104 }

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

+ Here is the call graph for this function:

◆ getDescription() [1/2]

ilMDDescription::getDescription ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescription() [2/2]

ilMDDescription::getDescription ( )

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

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

◆ getDescriptionLanguage() [1/2]

& ilMDDescription::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguage() [2/2]

& ilMDDescription::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode() [1/2]

ilMDDescription::getDescriptionLanguageCode ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionLanguageCode() [2/2]

ilMDDescription::getDescriptionLanguageCode ( )

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

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

◆ read() [1/2]

ilMDDescription::read ( )

Definition at line 118 of file class.ilMDDescription.php.

119 {
120 global $ilDB;
121
122 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
123
124 if($this->getMetaId())
125 {
126 $query = "SELECT * FROM il_meta_description ".
127 "WHERE meta_description_id = ".$ilDB->quote($this->getMetaId() ,'integer');
128
129 $res = $this->db->query($query);
130 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
131 {
132 $this->setRBACId($row->rbac_id);
133 $this->setObjId($row->obj_id);
134 $this->setObjType($row->obj_type);
135 $this->setParentId($row->parent_id);
136 $this->setParentType($row->parent_type);
137 $this->setDescription($row->description);
138 $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
139 }
140 }
141 return true;
142 }
setObjId($a_id)
setParentId($a_id)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)
setDescriptionLanguage(&$lng_obj)
setDescription($a_description)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDDescription::read ( )

Definition at line 118 of file class.ilMDDescription.php.

119 {
120 global $ilDB;
121
122 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
123
124 if($this->getMetaId())
125 {
126 $query = "SELECT * FROM il_meta_description ".
127 "WHERE meta_description_id = ".$ilDB->quote($this->getMetaId());
128
129 $res = $this->db->query($query);
130 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
131 {
132 $this->setRBACId($row->rbac_id);
133 $this->setObjId($row->obj_id);
134 $this->setObjType($row->obj_type);
135 $this->setParentId($row->parent_id);
136 $this->setParentType($row->parent_type);
137 $this->setDescription(ilUtil::stripSlashes($row->description));
138 $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
139 }
140 }
141 return true;
142 }
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(), setDescription(), setDescriptionLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDDescription::save ( )

Reimplemented from ilMDBase.

Definition at line 60 of file class.ilMDDescription.php.

61 {
62 global $ilDB;
63
64 $fields = $this->__getFields();
65 $fields['meta_description_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_description'));
66
67 if($this->db->insert('il_meta_description',$fields))
68 {
69 $this->setMetaId($next_id);
70 return $this->getMetaId();
71 }
72 return false;
73 }
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]

ilMDDescription::save ( )

Reimplemented from ilMDBase.

Definition at line 60 of file class.ilMDDescription.php.

61 {
62 if($this->db->autoExecute('il_meta_description',
63 $this->__getFields(),
65 {
66 $this->setMetaId($this->db->getLastInsertId());
67
68 return $this->getMetaId();
69 }
70 return false;
71 }

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

+ Here is the call graph for this function:

◆ setDescription() [1/2]

ilMDDescription::setDescription (   $a_description)

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

37 {
38 $this->description = $a_description;
39 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription() [2/2]

ilMDDescription::setDescription (   $a_description)

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

37 {
38 $this->description = $a_description;
39 }

◆ setDescriptionLanguage() [1/2]

ilMDDescription::setDescriptionLanguage ( $lng_obj)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescriptionLanguage() [2/2]

ilMDDescription::setDescriptionLanguage ( $lng_obj)

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

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

◆ toXML() [1/2]

ilMDDescription::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 149 of file class.ilMDDescription.php.

150 {
151 $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode() ?
153 'en'),
154 $this->getDescription());
155 }

References getDescription(), and getDescriptionLanguageCode().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDDescription::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 149 of file class.ilMDDescription.php.

150 {
151 $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
152 }

References getDescription(), and getDescriptionLanguageCode().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDDescription::update ( )

Reimplemented from ilMDBase.

Definition at line 75 of file class.ilMDDescription.php.

76 {
77 global $ilDB;
78
79 if($this->getMetaId())
80 {
81 if($this->db->update('il_meta_description',
82 $this->__getFields(),
83 array("meta_description_id" => array('integer',$this->getMetaId()))))
84 {
85 return true;
86 }
87 }
88 return false;
89 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDDescription::update ( )

Reimplemented from ilMDBase.

Definition at line 73 of file class.ilMDDescription.php.

74 {
75 global $ilDB;
76
77 if($this->getMetaId())
78 {
79 if($this->db->autoExecute('il_meta_description',
80 $this->__getFields(),
82 "meta_description_id = ".$ilDB->quote($this->getMetaId())))
83 {
84 return true;
85 }
86 }
87 return false;
88 }

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: