ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMDFormat Class Reference
+ Inheritance diagram for ilMDFormat:
+ Collaboration diagram for ilMDFormat:

Public Member Functions

 ilMDFormat ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 setFormat ($a_format)
 
 getFormat ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id)
 
 ilMDFormat ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 setFormat ($a_format)
 
 getFormat ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id)
 
- Public Member Functions inherited from ilMDBase
 ilMDBase ($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)
 
 ilMDBase ($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)
 

Additional Inherited Members

- Data Fields inherited from ilMDBase
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDFormat::__getFields ( )

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

101 {
102 return array('rbac_id' => array('integer',$this->getRBACId()),
103 'obj_id' => array('integer',$this->getObjId()),
104 'obj_type' => array('text',$this->getObjType()),
105 'format' => array('text',$this->getFormat()));
106 }

References getFormat(), 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]

ilMDFormat::__getFields ( )

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

101 {
102 return array('rbac_id' => $this->getRBACId(),
103 'obj_id' => $this->getObjId(),
104 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
105 'format' => ilUtil::prepareDBString($this->getFormat()));
106 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

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

+ Here is the call graph for this function:

◆ _getIds() [1/2]

ilMDFormat::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

147 {
148 global $ilDB;
149
150 $query = "SELECT meta_format_id FROM il_meta_format ".
151 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
152 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
153
154 $res = $ilDB->query($query);
155 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
156 {
157 $ids[] = $row->meta_format_id;
158 }
159 return $ids ? $ids : array();
160 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMDTechnical\getFormatIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDFormat::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

144 {
145 global $ilDB;
146
147 $query = "SELECT meta_format_id FROM il_meta_format ".
148 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
149 "AND obj_id = ".$ilDB->quote($a_obj_id);
150
151 $res = $ilDB->query($query);
152 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
153 {
154 $ids[] = $row->meta_format_id;
155 }
156 return $ids ? $ids : array();
157 }

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

◆ delete() [1/2]

ilMDFormat::delete ( )

Reimplemented from ilMDBase.

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

85 {
86 global $ilDB;
87
88 if($this->getMetaId())
89 {
90 $query = "DELETE FROM il_meta_format ".
91 "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId() ,'integer');
92 $res = $ilDB->manipulate($query);
93
94 return true;
95 }
96 return false;
97 }

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDFormat::delete ( )

Reimplemented from ilMDBase.

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

84 {
85 global $ilDB;
86
87 if($this->getMetaId())
88 {
89 $query = "DELETE FROM il_meta_format ".
90 "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId());
91
92 $this->db->query($query);
93
94 return true;
95 }
96 return false;
97 }

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

+ Here is the call graph for this function:

◆ getFormat() [1/2]

ilMDFormat::getFormat ( )

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

49 {
50 return $this->format;
51 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getFormat() [2/2]

ilMDFormat::getFormat ( )

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

49 {
50 return $this->format;
51 }

◆ ilMDFormat() [1/2]

ilMDFormat::ilMDFormat (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

37 {
38 parent::ilMDBase($a_rbac_id,
39 $a_obj_id,
40 $a_obj_type);
41 }

◆ ilMDFormat() [2/2]

ilMDFormat::ilMDFormat (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

37 {
38 parent::ilMDBase($a_rbac_id,
39 $a_obj_id,
40 $a_obj_type);
41 }

◆ read() [1/2]

ilMDFormat::read ( )

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

109 {
110 global $ilDB;
111
112 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
113
114 if($this->getMetaId())
115 {
116 $query = "SELECT * FROM il_meta_format ".
117 "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId() ,'integer');
118
119 $res = $this->db->query($query);
120 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
121 {
122 $this->setRBACId($row->rbac_id);
123 $this->setObjId($row->obj_id);
124 $this->setObjType($row->obj_type);
125 $this->setFormat($row->format);
126 }
127 }
128 return true;
129 }
setObjId($a_id)
setObjType($a_type)
setRBACId($a_id)
setFormat($a_format)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDFormat::read ( )

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

109 {
110 global $ilDB;
111
112 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
113
114 if($this->getMetaId())
115 {
116 $query = "SELECT * FROM il_meta_format ".
117 "WHERE meta_format_id = ".$ilDB->quote($this->getMetaId());
118
119 $res = $this->db->query($query);
120 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
121 {
122 $this->setRBACId($row->rbac_id);
123 $this->setObjId($row->obj_id);
124 $this->setObjType($row->obj_type);
125 $this->setFormat(ilUtil::stripSlashes($row->format));
126 }
127 }
128 return true;
129 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDFormat::save ( )

Reimplemented from ilMDBase.

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

54 {
55 global $ilDB;
56
57 $fields = $this->__getFields();
58 $fields['meta_format_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_format'));
59
60 if($this->db->insert('il_meta_format',$fields))
61 {
62 $this->setMetaId($next_id);
63 return $this->getMetaId();
64 }
65 return false;
66 }
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]

ilMDFormat::save ( )

Reimplemented from ilMDBase.

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

54 {
55 if($this->db->autoExecute('il_meta_format',
56 $this->__getFields(),
57 DB_AUTOQUERY_INSERT))
58 {
59 $this->setMetaId($this->db->getLastInsertId());
60
61 return $this->getMetaId();
62 }
63 return false;
64 }

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

+ Here is the call graph for this function:

◆ setFormat() [1/2]

ilMDFormat::setFormat (   $a_format)

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

45 {
46 $this->format = $a_format;
47 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setFormat() [2/2]

ilMDFormat::setFormat (   $a_format)

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

45 {
46 $this->format = $a_format;
47 }

◆ toXML() [1/2]

ilMDFormat::toXML ( $writer)

Reimplemented from ilMDBase.

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

137 {
138 if($this->getFormat())
139 {
140 $writer->xmlElement('Format',null,$this->getFormat());
141 }
142 }

References getFormat().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDFormat::toXML ( $writer)

Reimplemented from ilMDBase.

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

137 {
138 $writer->xmlElement('Format',null,$this->getFormat());
139 }

References getFormat().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDFormat::update ( )

Reimplemented from ilMDBase.

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

69 {
70 global $ilDB;
71
72 if($this->getMetaId())
73 {
74 if($this->db->update('il_meta_format',
75 $this->__getFields(),
76 array("meta_format_id" => array('integer',$this->getMetaId()))))
77 {
78 return true;
79 }
80 }
81 return false;
82 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDFormat::update ( )

Reimplemented from ilMDBase.

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

67 {
68 global $ilDB;
69
70 if($this->getMetaId())
71 {
72 if($this->db->autoExecute('il_meta_format',
73 $this->__getFields(),
74 DB_AUTOQUERY_UPDATE,
75 "meta_format_id = ".$ilDB->quote($this->getMetaId())))
76 {
77 return true;
78 }
79 }
80 return false;
81 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

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