ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 setFormat ($a_format)
 
 getFormat ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- 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)
 
 __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)
 
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/3]

ilMDFormat::__getFields ( )

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

References 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  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDFormat::__getFields ( )

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

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

Referenced by save().

98  {
99  return array('rbac_id' => array('integer',$this->getRBACId()),
100  'obj_id' => array('integer',$this->getObjId()),
101  'obj_type' => array('text',$this->getObjType()),
102  'format' => array('text',$this->getFormat()));
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [3/3]

ilMDFormat::__getFields ( )

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

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

98  {
99  return array('rbac_id' => array('integer',$this->getRBACId()),
100  'obj_id' => array('integer',$this->getObjId()),
101  'obj_type' => array('text',$this->getObjType()),
102  'format' => array('text',$this->getFormat()));
103  }
+ Here is the call graph for this function:

◆ _getIds() [1/3]

ilMDFormat::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

References $ilDB, $query, $res, $row, 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
$row
global $ilDB

◆ _getIds() [2/3]

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

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

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

Referenced by ilMDTechnical\getFormatIds().

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  $query = "SELECT meta_format_id FROM il_meta_format " .
149  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
150  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
151 
152  $res = $ilDB->query($query);
153  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
154  $ids[] = $row->meta_format_id;
155  }
156  return $ids ? $ids : array();
157  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getIds() [3/3]

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

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

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

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  $query = "SELECT meta_format_id FROM il_meta_format " .
149  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
150  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
151 
152  $res = $ilDB->query($query);
153  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
154  $ids[] = $row->meta_format_id;
155  }
156  return $ids ? $ids : array();
157  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ delete() [1/3]

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:

◆ delete() [2/3]

ilMDFormat::delete ( )

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

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

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  if ($this->getMetaId()) {
87  $query = "DELETE FROM il_meta_format " .
88  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId(), 'integer');
89  $res = $ilDB->manipulate($query);
90 
91  return true;
92  }
93  return false;
94  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDFormat::delete ( )

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

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

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  if ($this->getMetaId()) {
87  $query = "DELETE FROM il_meta_format " .
88  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId(), 'integer');
89  $res = $ilDB->manipulate($query);
90 
91  return true;
92  }
93  return false;
94  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ getFormat() [1/3]

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/3]

ilMDFormat::getFormat ( )

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

References $format.

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

◆ getFormat() [3/3]

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/3]

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
$row
global $ilDB
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDFormat::read ( )

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

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

106  {
107  global $DIC;
108 
109  $ilDB = $DIC['ilDB'];
110 
111  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
112 
113  if ($this->getMetaId()) {
114  $query = "SELECT * FROM il_meta_format " .
115  "WHERE meta_format_id = " . $ilDB->quote($this->getMetaId(), 'integer');
116 
117  $res = $this->db->query($query);
118  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
119  $this->setRBACId($row->rbac_id);
120  $this->setObjId($row->obj_id);
121  $this->setObjType($row->obj_type);
122  $this->setFormat($row->format);
123  }
124  }
125  return true;
126  }
setObjType($a_type)
global $DIC
Definition: saml.php:7
setFormat($a_format)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
$row
global $ilDB
+ Here is the call graph for this function:

◆ read() [3/3]

ilMDFormat::read ( )

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

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

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

◆ save() [1/3]

ilMDFormat::save ( )

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

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

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

◆ save() [2/3]

ilMDFormat::save ( )

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

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

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

◆ save() [3/3]

ilMDFormat::save ( )

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

References ilDBConstants\AUTOQUERY_INSERT, ilMDBase\getMetaId(), 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:

◆ setFormat() [1/3]

ilMDFormat::setFormat (   $a_format)

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

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

◆ setFormat() [2/3]

ilMDFormat::setFormat (   $a_format)

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

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

◆ setFormat() [3/3]

ilMDFormat::setFormat (   $a_format)

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

Referenced by read().

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

◆ toXML() [1/3]

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:

◆ toXML() [2/3]

ilMDFormat::toXML ( $writer)

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

References getFormat().

134  {
135  if ($this->getFormat()) {
136  $writer->xmlElement('Format', null, $this->getFormat());
137  }
138  }
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDFormat::toXML ( $writer)

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

References getFormat().

134  {
135  if ($this->getFormat()) {
136  $writer->xmlElement('Format', null, $this->getFormat());
137  }
138  }
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDFormat::update ( )

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

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

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:

◆ update() [2/3]

ilMDFormat::update ( )

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

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

63  {
64  global $DIC;
65 
66  $ilDB = $DIC['ilDB'];
67 
68  if ($this->getMetaId()) {
69  if ($this->db->update(
70  'il_meta_format',
71  $this->__getFields(),
72  array("meta_format_id" => array('integer',$this->getMetaId()))
73  )) {
74  return true;
75  }
76  }
77  return false;
78  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDFormat::update ( )

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

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

63  {
64  global $DIC;
65 
66  $ilDB = $DIC['ilDB'];
67 
68  if ($this->getMetaId()) {
69  if ($this->db->update(
70  'il_meta_format',
71  $this->__getFields(),
72  array("meta_format_id" => array('integer',$this->getMetaId()))
73  )) {
74  return true;
75  }
76  }
77  return false;
78  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

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