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

Public Member Functions

 setEntity ($a_entity)
 
 getEntity ()
 
 setDate ($a_date)
 
 getDate ()
 
 setDescription ($a_desc)
 
 getDescription ()
 
 setDescriptionLanguage ($lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setEntity ($a_entity)
 
 getEntity ()
 
 setDate ($a_date)
 
 getDate ()
 
 setDescription ($a_desc)
 
 getDescription ()
 
 setDescriptionLanguage ($lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id)
 
- 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)
 

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.ilMDAnnotation.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDAnnotation::__getFields ( )

Definition at line 123 of file class.ilMDAnnotation.php.

124 {
125 return array('rbac_id' => array('integer',$this->getRBACId()),
126 'obj_id' => array('integer',$this->getObjId()),
127 'obj_type' => array('text',$this->getObjType()),
128 'entity' => array('clob',$this->getEntity()),
129 'a_date' => array('clob',$this->getDate()),
130 'description' => array('clob',$this->getDescription()),
131 'description_language' => array('text',$this->getDescriptionLanguageCode()));
132 }

References getDate(), getDescription(), getDescriptionLanguageCode(), getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), 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]

ilMDAnnotation::__getFields ( )

Definition at line 125 of file class.ilMDAnnotation.php.

126 {
127 return array('rbac_id' => $this->getRBACId(),
128 'obj_id' => $this->getObjId(),
129 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
130 'entity' => ilUtil::prepareDBString($this->getEntity()),
131 'date' => ilUtil::prepareDBString($this->getDate()),
132 'description' => ilUtil::prepareDBString($this->getDescription()),
133 'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
134 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References getDate(), getDescription(), getDescriptionLanguageCode(), getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

static ilMDAnnotation::_getIds (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 181 of file class.ilMDAnnotation.php.

182 {
183 global $ilDB;
184
185 $query = "SELECT meta_annotation_id FROM il_meta_annotation " .
186 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
187 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
188
189
190 $res = $ilDB->query($query);
191 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
192 $ids[] = $row->meta_annotation_id;
193 }
194 return $ids ? $ids : array();
195 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB

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

Referenced by ilMD\getAnnotationIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDAnnotation::_getIds (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 177 of file class.ilMDAnnotation.php.

178 {
179 global $ilDB;
180
181 $query = "SELECT meta_annotation_id FROM il_meta_annotation " .
182 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
183 "AND obj_id = " . $ilDB->quote($a_obj_id);
184
185
186 $res = $ilDB->query($query);
187 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188 $ids[] = $row->meta_annotation_id;
189 }
190 return $ids ? $ids : array();
191 }

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

◆ delete() [1/2]

ilMDAnnotation::delete ( )

Reimplemented from ilMDBase.

Definition at line 108 of file class.ilMDAnnotation.php.

109 {
110 global $ilDB;
111
112 if ($this->getMetaId()) {
113 $query = "DELETE FROM il_meta_annotation " .
114 "WHERE meta_annotation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
115 $res = $ilDB->manipulate($query);
116
117 return true;
118 }
119 return false;
120 }

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDAnnotation::delete ( )

Reimplemented from ilMDBase.

Definition at line 109 of file class.ilMDAnnotation.php.

110 {
111 global $ilDB;
112
113 if ($this->getMetaId()) {
114 $query = "DELETE FROM il_meta_annotation " .
115 "WHERE meta_annotation_id = " . $ilDB->quote($this->getMetaId());
116
117 $this->db->query($query);
118
119 return true;
120 }
121 return false;
122 }

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

+ Here is the call graph for this function:

◆ getDate() [1/2]

ilMDAnnotation::getDate ( )

Definition at line 48 of file class.ilMDAnnotation.php.

49 {
50 return $this->date;
51 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDate() [2/2]

ilMDAnnotation::getDate ( )

Definition at line 48 of file class.ilMDAnnotation.php.

49 {
50 return $this->date;
51 }

◆ getDescription() [1/2]

ilMDAnnotation::getDescription ( )

Definition at line 56 of file class.ilMDAnnotation.php.

57 {
58 return $this->description;
59 }

References $description.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescription() [2/2]

ilMDAnnotation::getDescription ( )

Definition at line 56 of file class.ilMDAnnotation.php.

57 {
58 return $this->description;
59 }

References $description.

◆ getDescriptionLanguage() [1/2]

& ilMDAnnotation::getDescriptionLanguage ( )

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

67 {
68 return $this->description_language;
69 }

◆ getDescriptionLanguage() [2/2]

& ilMDAnnotation::getDescriptionLanguage ( )

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

67 {
68 return $this->description_language;
69 }

◆ getDescriptionLanguageCode() [1/2]

ilMDAnnotation::getDescriptionLanguageCode ( )

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

71 {
72 if (is_object($this->description_language)) {
73 return $this->description_language->getLanguageCode();
74 }
75 return false;
76 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionLanguageCode() [2/2]

ilMDAnnotation::getDescriptionLanguageCode ( )

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

71 {
72 if (is_object($this->description_language)) {
73 return $this->description_language->getLanguageCode();
74 }
75 return false;
76 }

◆ getEntity() [1/2]

ilMDAnnotation::getEntity ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getEntity() [2/2]

ilMDAnnotation::getEntity ( )

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

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

◆ read() [1/2]

ilMDAnnotation::read ( )

Definition at line 134 of file class.ilMDAnnotation.php.

135 {
136 global $ilDB;
137
138 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
139
140 if ($this->getMetaId()) {
141 $query = "SELECT * FROM il_meta_annotation " .
142 "WHERE meta_annotation_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->setEntity($row->entity);
150 $this->setDate($row->a_date);
151 $this->setDescription($row->description);
152 $this->description_language = new ilMDLanguageItem($row->description_language);
153 }
154 }
155 return true;
156 }
setObjId($a_id)
setObjType($a_type)
setRBACId($a_id)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDAnnotation::read ( )

Definition at line 136 of file class.ilMDAnnotation.php.

137 {
138 global $ilDB;
139
140 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
141
142 if ($this->getMetaId()) {
143 $query = "SELECT * FROM il_meta_annotation " .
144 "WHERE meta_annotation_id = " . $ilDB->quote($this->getMetaId());
145
146 $res = $this->db->query($query);
147 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
148 $this->setRBACId($row->rbac_id);
149 $this->setObjId($row->obj_id);
150 $this->setObjType($row->obj_type);
151 $this->setEntity(ilUtil::stripSlashes($row->entity));
152 $this->setDate(ilUtil::stripSlashes($row->date));
153 $this->setDescription(ilUtil::stripSlashes($row->description));
154 $this->description_language = new ilMDLanguageItem($row->description_language);
155 }
156 }
157 return true;
158 }
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(), setDate(), setDescription(), setEntity(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDAnnotation::save ( )

Reimplemented from ilMDBase.

Definition at line 78 of file class.ilMDAnnotation.php.

79 {
80 global $ilDB;
81
82 $fields = $this->__getFields();
83 $fields['meta_annotation_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_annotation'));
84
85 if ($this->db->insert('il_meta_annotation', $fields)) {
86 $this->setMetaId($next_id);
87 return $this->getMetaId();
88 }
89 return false;
90 }
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]

ilMDAnnotation::save ( )

Reimplemented from ilMDBase.

Definition at line 78 of file class.ilMDAnnotation.php.

79 {
80 if ($this->db->autoExecute(
81 'il_meta_annotation',
82 $this->__getFields(),
84 )) {
85 $this->setMetaId($this->db->getLastInsertId());
86
87 return $this->getMetaId();
88 }
89 return false;
90 }

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

+ Here is the call graph for this function:

◆ setDate() [1/2]

ilMDAnnotation::setDate (   $a_date)

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

45 {
46 $this->date = $a_date;
47 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())

References date.

Referenced by read().

+ Here is the caller graph for this function:

◆ setDate() [2/2]

ilMDAnnotation::setDate (   $a_date)

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

45 {
46 $this->date = $a_date;
47 }

References date.

◆ setDescription() [1/2]

ilMDAnnotation::setDescription (   $a_desc)

Definition at line 52 of file class.ilMDAnnotation.php.

53 {
54 $this->description = $a_desc;
55 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription() [2/2]

ilMDAnnotation::setDescription (   $a_desc)

Definition at line 52 of file class.ilMDAnnotation.php.

53 {
54 $this->description = $a_desc;
55 }

◆ setDescriptionLanguage() [1/2]

ilMDAnnotation::setDescriptionLanguage (   $lng_obj)

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

61 {
62 if (is_object($lng_obj)) {
63 $this->description_language =&$lng_obj;
64 }
65 }

◆ setDescriptionLanguage() [2/2]

ilMDAnnotation::setDescriptionLanguage (   $lng_obj)

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

61 {
62 if (is_object($lng_obj)) {
63 $this->description_language =&$lng_obj;
64 }
65 }

◆ setEntity() [1/2]

ilMDAnnotation::setEntity (   $a_entity)

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

37 {
38 $this->entity = $a_entity;
39 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEntity() [2/2]

ilMDAnnotation::setEntity (   $a_entity)

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

37 {
38 $this->entity = $a_entity;
39 }

◆ toXML() [1/2]

ilMDAnnotation::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 163 of file class.ilMDAnnotation.php.

164 {
165 $writer->xmlStartTag('Annotation');
166 $writer->xmlElement('Entity', null, $this->getEntity());
167 $writer->xmlElement('Date', null, $this->getDate());
168 $writer->xmlElement(
169 'Description',
170 array('Language' => $this->getDescriptionLanguageCode()
172 : 'en'),
173 $this->getDescription()
174 );
175 $writer->xmlEndTag('Annotation');
176 }

References getDate(), getDescription(), getDescriptionLanguageCode(), and getEntity().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDAnnotation::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 165 of file class.ilMDAnnotation.php.

166 {
167 $writer->xmlStartTag('Annotation');
168 $writer->xmlElement('Entity', null, $this->getEntity());
169 $writer->xmlElement('Date', null, $this->getDate());
170 $writer->xmlElement('Description', array('Language' => $this->getDescriptionLanguageCode()), $this->getDescription());
171 $writer->xmlEndTag('Annotation');
172 }

References getDate(), getDescription(), getDescriptionLanguageCode(), and getEntity().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDAnnotation::update ( )

Reimplemented from ilMDBase.

Definition at line 92 of file class.ilMDAnnotation.php.

93 {
94 global $ilDB;
95
96 if ($this->getMetaId()) {
97 if ($this->db->update(
98 'il_meta_annotation',
99 $this->__getFields(),
100 array("meta_annotation_id" => array('integer',$this->getMetaId()))
101 )) {
102 return true;
103 }
104 }
105 return false;
106 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDAnnotation::update ( )

Reimplemented from ilMDBase.

Definition at line 92 of file class.ilMDAnnotation.php.

93 {
94 global $ilDB;
95
96 if ($this->getMetaId()) {
97 if ($this->db->autoExecute(
98 'il_meta_annotation',
99 $this->__getFields(),
101 "meta_annotation_id = " . $ilDB->quote($this->getMetaId())
102 )) {
103 return true;
104 }
105 }
106 return false;
107 }

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: