ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMD5295Annotation Class Reference
+ Inheritance diagram for ilMD5295Annotation:
+ Collaboration diagram for ilMD5295Annotation:

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)
 
- 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)
 

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

Member Function Documentation

◆ __getFields()

ilMD5295Annotation::__getFields ( )

Definition at line 129 of file class.ilMD5295Annotation.php.

References getDate(), getDescription(), getDescriptionLanguageCode(), getEntity(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), and ilMD5295Base\getRBACId().

Referenced by save().

130  {
131  return array('rbac_id' => array('integer',$this->getRBACId()),
132  'obj_id' => array('integer',$this->getObjId()),
133  'obj_type' => array('text',$this->getObjType()),
134  'entity' => array('clob',$this->getEntity()),
135  'a_date' => array('clob',$this->getDate()),
136  'description' => array('clob',$this->getDescription()),
137  'description_language' => array('text',$this->getDescriptionLanguageCode()));
138  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds()

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

Definition at line 189 of file class.ilMD5295Annotation.php.

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

Referenced by ilMD5295\getAnnotationIds().

190  {
191  global $DIC;
192 
193  $ilDB = $DIC['ilDB'];
194 
195  $query = "SELECT meta_annotation_id FROM il_meta_annotation " .
196  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
197  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
198 
199 
200  $res = $ilDB->query($query);
201  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
202  $ids[] = $row->meta_annotation_id;
203  }
204  return $ids ? $ids : array();
205  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ delete()

ilMD5295Annotation::delete ( )

Definition at line 112 of file class.ilMD5295Annotation.php.

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

113  {
114  global $DIC;
115 
116  $ilDB = $DIC['ilDB'];
117 
118  if ($this->getMetaId()) {
119  $query = "DELETE FROM il_meta_annotation " .
120  "WHERE meta_annotation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
121  $res = $ilDB->manipulate($query);
122 
123  return true;
124  }
125  return false;
126  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getDate()

ilMD5295Annotation::getDate ( )

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

Referenced by __getFields(), and toXML().

49  {
50  return $this->date;
51  }
+ Here is the caller graph for this function:

◆ getDescription()

ilMD5295Annotation::getDescription ( )

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

Referenced by __getFields(), and toXML().

57  {
58  return $this->description;
59  }
+ Here is the caller graph for this function:

◆ getDescriptionLanguage()

& ilMD5295Annotation::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode()

ilMD5295Annotation::getDescriptionLanguageCode ( )

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

Referenced by __getFields(), and toXML().

71  {
72  if (is_object($this->description_language)) {
73  return $this->description_language->getLanguageCode();
74  }
75  return false;
76  }
+ Here is the caller graph for this function:

◆ getEntity()

ilMD5295Annotation::getEntity ( )

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

Referenced by __getFields(), and toXML().

41  {
42  return $this->entity;
43  }
+ Here is the caller graph for this function:

◆ read()

ilMD5295Annotation::read ( )

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

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

141  {
142  global $DIC;
143 
144  $ilDB = $DIC['ilDB'];
145 
146  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
147 
148  if ($this->getMetaId()) {
149  $query = "SELECT * FROM il_meta_annotation " .
150  "WHERE meta_annotation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
151 
152  $res = $this->db->query($query);
153  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
154  $this->setRBACId($row->rbac_id);
155  $this->setObjId($row->obj_id);
156  $this->setObjType($row->obj_type);
157  $this->setEntity($row->entity);
158  $this->setDate($row->a_date);
159  $this->setDescription($row->description);
160  $this->description_language = new ilMD5295LanguageItem($row->description_language);
161  }
162  }
163  return true;
164  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ save()

ilMD5295Annotation::save ( )

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

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

79  {
80  global $DIC;
81 
82  $ilDB = $DIC['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  $this->setMetaId($next_id);
89  return $this->getMetaId();
90  }
91  return false;
92  }
global $ilDB
$DIC
Definition: xapitoken.php:46
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setDate()

ilMD5295Annotation::setDate (   $a_date)

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

Referenced by read().

45  {
46  $this->date = $a_date;
47  }
+ Here is the caller graph for this function:

◆ setDescription()

ilMD5295Annotation::setDescription (   $a_desc)

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

Referenced by read().

53  {
54  $this->description = $a_desc;
55  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage()

ilMD5295Annotation::setDescriptionLanguage (   $lng_obj)

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

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

◆ setEntity()

ilMD5295Annotation::setEntity (   $a_entity)

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

Referenced by read().

37  {
38  $this->entity = $a_entity;
39  }
+ Here is the caller graph for this function:

◆ toXML()

ilMD5295Annotation::toXML ( $writer)

Definition at line 171 of file class.ilMD5295Annotation.php.

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

172  {
173  $writer->xmlStartTag('Annotation');
174  $writer->xmlElement('Entity', null, $this->getEntity());
175  $writer->xmlElement('Date', null, $this->getDate());
176  $writer->xmlElement(
177  'Description',
178  array('Language' => $this->getDescriptionLanguageCode()
179  ? $this->getDescriptionLanguageCode()
180  : 'en'),
181  $this->getDescription()
182  );
183  $writer->xmlEndTag('Annotation');
184  }
+ Here is the call graph for this function:

◆ update()

ilMD5295Annotation::update ( )

Definition at line 94 of file class.ilMD5295Annotation.php.

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

95  {
96  global $DIC;
97 
98  $ilDB = $DIC['ilDB'];
99 
100  if ($this->getMetaId()) {
101  if ($this->db->update(
102  'il_meta_annotation',
103  $this->__getFields(),
104  array("meta_annotation_id" => array('integer',$this->getMetaId()))
105  )) {
106  return true;
107  }
108  }
109  return false;
110  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

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