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

Public Member Functions

 setFormat ($a_format)
 
 getFormat ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setFormat ($a_format)
 
 getFormat ()
 
 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 34 of file class.ilMDFormat.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDFormat::__getFields ( )

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

References array, getFormat(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

Referenced by save().

92  {
93  return array('rbac_id' => array('integer',$this->getRBACId()),
94  'obj_id' => array('integer',$this->getObjId()),
95  'obj_type' => array('text',$this->getObjType()),
96  'format' => array('text',$this->getFormat()));
97  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDFormat::__getFields ( )

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

References array, getFormat(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

94  {
95  return array('rbac_id' => $this->getRBACId(),
96  'obj_id' => $this->getObjId(),
97  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
98  'format' => ilUtil::prepareDBString($this->getFormat()));
99  }
Create styles array
The data for the language used.
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

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

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

Referenced by ilMDTechnical\getFormatIds().

135  {
136  global $ilDB;
137 
138  $query = "SELECT meta_format_id FROM il_meta_format " .
139  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
140  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
141 
142  $res = $ilDB->query($query);
143  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
144  $ids[] = $row->meta_format_id;
145  }
146  return $ids ? $ids : array();
147  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDFormat::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

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

135  {
136  global $ilDB;
137 
138  $query = "SELECT meta_format_id FROM il_meta_format " .
139  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
140  "AND obj_id = " . $ilDB->quote($a_obj_id);
141 
142  $res = $ilDB->query($query);
143  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
144  $ids[] = $row->meta_format_id;
145  }
146  return $ids ? $ids : array();
147  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ delete() [1/2]

ilMDFormat::delete ( )

Definition at line 76 of file class.ilMDFormat.php.

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

77  {
78  global $ilDB;
79 
80  if ($this->getMetaId()) {
81  $query = "DELETE FROM il_meta_format " .
82  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId(), 'integer');
83  $res = $ilDB->manipulate($query);
84 
85  return true;
86  }
87  return false;
88  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDFormat::delete ( )

Definition at line 77 of file class.ilMDFormat.php.

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

78  {
79  global $ilDB;
80 
81  if ($this->getMetaId()) {
82  $query = "DELETE FROM il_meta_format " .
83  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId());
84 
85  $this->db->query($query);
86 
87  return true;
88  }
89  return false;
90  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getFormat() [1/2]

ilMDFormat::getFormat ( )

Definition at line 41 of file class.ilMDFormat.php.

References $format.

Referenced by __getFields(), and toXML().

42  {
43  return $this->format;
44  }
$format
Definition: metadata.php:141
+ Here is the caller graph for this function:

◆ getFormat() [2/2]

ilMDFormat::getFormat ( )

Definition at line 41 of file class.ilMDFormat.php.

References $format.

42  {
43  return $this->format;
44  }
$format
Definition: metadata.php:141

◆ read() [1/2]

ilMDFormat::read ( )

Definition at line 99 of file class.ilMDFormat.php.

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

100  {
101  global $ilDB;
102 
103  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
104 
105  if ($this->getMetaId()) {
106  $query = "SELECT * FROM il_meta_format " .
107  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId(), 'integer');
108 
109  $res = $this->db->query($query);
110  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111  $this->setRBACId($row->rbac_id);
112  $this->setObjId($row->obj_id);
113  $this->setObjType($row->obj_type);
114  $this->setFormat($row->format);
115  }
116  }
117  return true;
118  }
setObjType($a_type)
setFormat($a_format)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
global $ilDB
+ Here is the call graph for this function:

◆ read() [2/2]

ilMDFormat::read ( )

Definition at line 101 of file class.ilMDFormat.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setFormat(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

102  {
103  global $ilDB;
104 
105  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
106 
107  if ($this->getMetaId()) {
108  $query = "SELECT * FROM il_meta_format " .
109  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId());
110 
111  $res = $this->db->query($query);
112  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
113  $this->setRBACId($row->rbac_id);
114  $this->setObjId($row->obj_id);
115  $this->setObjType($row->obj_type);
116  $this->setFormat(ilUtil::stripSlashes($row->format));
117  }
118  }
119  return true;
120  }
setObjType($a_type)
setFormat($a_format)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilDB
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDFormat::save ( )

Definition at line 46 of file class.ilMDFormat.php.

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

47  {
48  if ($this->db->autoExecute(
49  'il_meta_format',
50  $this->__getFields(),
52  )) {
53  $this->setMetaId($this->db->getLastInsertId());
54 
55  return $this->getMetaId();
56  }
57  return false;
58  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDFormat::save ( )

Definition at line 46 of file class.ilMDFormat.php.

References $ilDB, __getFields(), array, ilMDBase\getMetaId(), and ilMDBase\setMetaId().

47  {
48  global $ilDB;
49 
50  $fields = $this->__getFields();
51  $fields['meta_format_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_format'));
52 
53  if ($this->db->insert('il_meta_format', $fields)) {
54  $this->setMetaId($next_id);
55  return $this->getMetaId();
56  }
57  return false;
58  }
setMetaId($a_meta_id, $a_read_data=true)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ setFormat() [1/2]

ilMDFormat::setFormat (   $a_format)

Definition at line 37 of file class.ilMDFormat.php.

References format.

38  {
39  $this->format = $a_format;
40  }
Write to Excel2007 format

◆ setFormat() [2/2]

ilMDFormat::setFormat (   $a_format)

Definition at line 37 of file class.ilMDFormat.php.

References format.

Referenced by read().

38  {
39  $this->format = $a_format;
40  }
Write to Excel2007 format
+ Here is the caller graph for this function:

◆ toXML() [1/2]

ilMDFormat::toXML ( $writer)

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

References getFormat().

126  {
127  if ($this->getFormat()) {
128  $writer->xmlElement('Format', null, $this->getFormat());
129  }
130  }
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDFormat::toXML ( $writer)

Definition at line 127 of file class.ilMDFormat.php.

References getFormat().

128  {
129  $writer->xmlElement('Format', null, $this->getFormat());
130  }
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDFormat::update ( )

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

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

61  {
62  global $ilDB;
63 
64  if ($this->getMetaId()) {
65  if ($this->db->update(
66  'il_meta_format',
67  $this->__getFields(),
68  array("meta_format_id" => array('integer',$this->getMetaId()))
69  )) {
70  return true;
71  }
72  }
73  return false;
74  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDFormat::update ( )

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

References $ilDB, ilMDBase\getMetaId(), and ilDBConstants\MDB2_AUTOQUERY_UPDATE.

61  {
62  global $ilDB;
63 
64  if ($this->getMetaId()) {
65  if ($this->db->autoExecute(
66  'il_meta_format',
67  $this->__getFields(),
69  "meta_format_id = " . $ilDB->quote($this->getMetaId())
70  )) {
71  return true;
72  }
73  }
74  return false;
75  }
global $ilDB
+ Here is the call graph for this function:

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