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

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

Referenced by save().

94  {
95  return array('rbac_id' => array('integer',$this->getRBACId()),
96  'obj_id' => array('integer',$this->getObjId()),
97  'obj_type' => array('text',$this->getObjType()),
98  'format' => array('text',$this->getFormat()));
99  }
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]

ilMDFormat::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

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

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

◆ _getIds() [2/2]

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

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

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

Referenced by ilMDTechnical\getFormatIds().

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

◆ delete() [1/2]

ilMDFormat::delete ( )

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

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

77  {
78  global $ilDB;
79 
80  if($this->getMetaId())
81  {
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  }
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, $res, and ilMDBase\getMetaId().

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

◆ getFormat() [1/2]

ilMDFormat::getFormat ( )

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

Referenced by __getFields(), and toXML().

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

◆ getFormat() [2/2]

ilMDFormat::getFormat ( )

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

42  {
43  return $this->format;
44  }

◆ read() [1/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  {
109  $query = "SELECT * FROM il_meta_format ".
110  "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId());
111 
112  $res = $this->db->query($query);
113  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
114  {
115  $this->setRBACId($row->rbac_id);
116  $this->setObjId($row->obj_id);
117  $this->setObjType($row->obj_type);
118  $this->setFormat(ilUtil::stripSlashes($row->format));
119  }
120  }
121  return true;
122  }
setObjType($a_type)
setFormat($a_format)
setObjId($a_id)
setRBACId($a_id)
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:

◆ 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(), and ilMDBase\setRBACId().

102  {
103  global $ilDB;
104 
105  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
106 
107  if($this->getMetaId())
108  {
109  $query = "SELECT * FROM il_meta_format ".
110  "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId() ,'integer');
111 
112  $res = $this->db->query($query);
113  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
114  {
115  $this->setRBACId($row->rbac_id);
116  $this->setObjId($row->obj_id);
117  $this->setObjType($row->obj_type);
118  $this->setFormat($row->format);
119  }
120  }
121  return true;
122  }
setObjType($a_type)
setFormat($a_format)
setObjId($a_id)
setRBACId($a_id)
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('il_meta_format',
49  $this->__getFields(),
51  {
52  $this->setMetaId($this->db->getLastInsertId());
53 
54  return $this->getMetaId();
55  }
56  return false;
57  }
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  {
55  $this->setMetaId($next_id);
56  return $this->getMetaId();
57  }
58  return false;
59  }
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.

Referenced by read().

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

◆ setFormat() [2/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

◆ toXML() [1/2]

ilMDFormat::toXML ( $writer)

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

References getFormat().

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

◆ toXML() [2/2]

ilMDFormat::toXML ( $writer)

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

References getFormat().

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

◆ update() [1/2]

ilMDFormat::update ( )

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

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

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

◆ update() [2/2]

ilMDFormat::update ( )

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

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

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

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