ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 127 of file class.ilMDAnnotation.php.

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

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 127 of file class.ilMDAnnotation.php.

128 {
129 return array('rbac_id' => $this->getRBACId(),
130 'obj_id' => $this->getObjId(),
131 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
132 'entity' => ilUtil::prepareDBString($this->getEntity()),
133 'date' => ilUtil::prepareDBString($this->getDate()),
134 'description' => ilUtil::prepareDBString($this->getDescription()),
135 'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
136 }
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 184 of file class.ilMDAnnotation.php.

185 {
186 global $ilDB;
187
188 $query = "SELECT meta_annotation_id FROM il_meta_annotation ".
189 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
190 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
191
192
193 $res = $ilDB->query($query);
194 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
195 {
196 $ids[] = $row->meta_annotation_id;
197 }
198 return $ids ? $ids : array();
199 }
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 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)." ".
187 "AND obj_id = ".$ilDB->quote($a_obj_id);
188
189
190 $res = $ilDB->query($query);
191 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
192 {
193 $ids[] = $row->meta_annotation_id;
194 }
195 return $ids ? $ids : array();
196 }

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

◆ delete() [1/2]

ilMDAnnotation::delete ( )

Reimplemented from ilMDBase.

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

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

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 110 of file class.ilMDAnnotation.php.

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

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 }

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 }

◆ getDescriptionLanguage() [1/2]

& ilMDAnnotation::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguage() [2/2]

& ilMDAnnotation::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode() [1/2]

ilMDAnnotation::getDescriptionLanguageCode ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionLanguageCode() [2/2]

ilMDAnnotation::getDescriptionLanguageCode ( )

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

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

◆ 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 138 of file class.ilMDAnnotation.php.

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

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

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

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

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 {
64 $this->description_language =& $lng_obj;
65 }
66 }

◆ setDescriptionLanguage() [2/2]

ilMDAnnotation::setDescriptionLanguage (   $lng_obj)

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

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

◆ 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 169 of file class.ilMDAnnotation.php.

170 {
171 $writer->xmlStartTag('Annotation');
172 $writer->xmlElement('Entity',null,$this->getEntity());
173 $writer->xmlElement('Date',null,$this->getDate());
174 $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()
176 : 'en'),
177 $this->getDescription());
178 $writer->xmlEndTag('Annotation');
179 }

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 169 of file class.ilMDAnnotation.php.

170 {
171 $writer->xmlStartTag('Annotation');
172 $writer->xmlElement('Entity',null,$this->getEntity());
173 $writer->xmlElement('Date',null,$this->getDate());
174 $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
175 $writer->xmlEndTag('Annotation');
176 }

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 95 of file class.ilMDAnnotation.php.

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

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDAnnotation::update ( )

Reimplemented from ilMDBase.

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

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

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: