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

Public Member Functions

 ilMDIdentifier_ ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 setCatalog ($a_catalog)
 
 getCatalog ()
 
 setEntry ($a_entry)
 
 getEntry ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
 ilMDIdentifier_ ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 setCatalog ($a_catalog)
 
 getCatalog ()
 
 setEntry ($a_entry)
 
 getEntry ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
- 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 33 of file class.ilMDIdentifier_.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDIdentifier_::__getFields ( )

Definition at line 107 of file class.ilMDIdentifier_.php.

108 {
109 return array('rbac_id' => array('integer',$this->getRBACId()),
110 'obj_id' => array('integer',$this->getObjId()),
111 'obj_type' => array('text',$this->getObjType()),
112 'parent_type' => array('text',$this->getParentType()),
113 'parent_id' => array('integer',$this->getParentId()),
114 'catalog' => array('text',$this->getCatalog()),
115 'entry' => array('text',$this->getEntry()));
116 }

References getCatalog(), getEntry(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), 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]

ilMDIdentifier_::__getFields ( )

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

109 {
110 return array('rbac_id' => $this->getRBACId(),
111 'obj_id' => $this->getObjId(),
112 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
113 'parent_type' => $this->getParentType(),
114 'parent_id' => $this->getParentId(),
115 'catalog' => ilUtil::prepareDBString($this->getCatalog()),
116 'entry' => ilUtil::prepareDBString($this->getEntry()));
117
118 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References getCatalog(), getEntry(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

ilMDIdentifier_::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 155 of file class.ilMDIdentifier_.php.

156 {
157 global $ilDB;
158
159 $query = "SELECT meta_identifier__id FROM il_meta_identifier_ ".
160 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
161 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
162 "AND parent_id = ".$ilDB->quote($a_parent_id ,'integer')." ".
163 "AND parent_type = ".$ilDB->quote($a_parent_type ,'text');
164
165
166 $res = $ilDB->query($query);
167 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
168 {
169 $ids[] = $row->meta_identifier__id;
170 }
171 return $ids ? $ids : array();
172 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

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

Referenced by ilMDRelation\getIdentifier_Ids().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDIdentifier_::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 157 of file class.ilMDIdentifier_.php.

158 {
159 global $ilDB;
160
161 $query = "SELECT meta_identifier__id FROM il_meta_identifier_ ".
162 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
163 "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
164 "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
165 "AND parent_type = ".$ilDB->quote($a_parent_type);
166
167
168 $res = $ilDB->query($query);
169 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
170 {
171 $ids[] = $row->meta_identifier__id;
172 }
173 return $ids ? $ids : array();
174 }

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

◆ delete() [1/2]

ilMDIdentifier_::delete ( )

Reimplemented from ilMDBase.

Definition at line 92 of file class.ilMDIdentifier_.php.

93 {
94 global $ilDB;
95
96 if($this->getMetaId())
97 {
98 $query = "DELETE FROM il_meta_identifier_ ".
99 "WHERE meta_identifier__id = ".$ilDB->quote($this->getMetaId() ,'integer');
100 $res = $ilDB->manipulate($query);
101 return true;
102 }
103 return false;
104 }

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDIdentifier_::delete ( )

Reimplemented from ilMDBase.

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

92 {
93 global $ilDB;
94
95 if($this->getMetaId())
96 {
97 $query = "DELETE FROM il_meta_identifier_ ".
98 "WHERE meta_identifier__id = ".$ilDB->quote($this->getMetaId());
99
100 $this->db->query($query);
101
102 return true;
103 }
104 return false;
105 }

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

+ Here is the call graph for this function:

◆ getCatalog() [1/2]

ilMDIdentifier_::getCatalog ( )

Definition at line 47 of file class.ilMDIdentifier_.php.

48 {
49 return $this->catalog;
50 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getCatalog() [2/2]

ilMDIdentifier_::getCatalog ( )

Definition at line 47 of file class.ilMDIdentifier_.php.

48 {
49 return $this->catalog;
50 }

◆ getEntry() [1/2]

ilMDIdentifier_::getEntry ( )

Definition at line 55 of file class.ilMDIdentifier_.php.

56 {
57 return $this->entry;
58 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getEntry() [2/2]

ilMDIdentifier_::getEntry ( )

Definition at line 55 of file class.ilMDIdentifier_.php.

56 {
57 return $this->entry;
58 }

◆ ilMDIdentifier_() [1/2]

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

Definition at line 35 of file class.ilMDIdentifier_.php.

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

◆ ilMDIdentifier_() [2/2]

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

Definition at line 35 of file class.ilMDIdentifier_.php.

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

◆ read() [1/2]

ilMDIdentifier_::read ( )

Definition at line 118 of file class.ilMDIdentifier_.php.

119 {
120 global $ilDB;
121
122 if($this->getMetaId())
123 {
124 $query = "SELECT * FROM il_meta_identifier_ ".
125 "WHERE meta_identifier__id = ".$ilDB->quote($this->getMetaId() ,'integer');
126
127 $res = $this->db->query($query);
128 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
129 {
130 $this->setRBACId($row->rbac_id);
131 $this->setObjId($row->obj_id);
132 $this->setObjType($row->obj_type);
133 $this->setParentId($row->parent_id);
134 $this->setParentType($row->parent_type);
135 $this->setCatalog($row->catalog);
136 $this->setEntry($row->entry);
137 }
138 }
139 return true;
140 }
setObjId($a_id)
setParentId($a_id)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCatalog(), setEntry(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), and ilMDBase\setRBACId().

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDIdentifier_::read ( )

Definition at line 120 of file class.ilMDIdentifier_.php.

121 {
122 global $ilDB;
123
124 if($this->getMetaId())
125 {
126 $query = "SELECT * FROM il_meta_identifier_ ".
127 "WHERE meta_identifier__id = ".$ilDB->quote($this->getMetaId());
128
129 $res = $this->db->query($query);
130 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
131 {
132 $this->setRBACId($row->rbac_id);
133 $this->setObjId($row->obj_id);
134 $this->setObjType($row->obj_type);
135 $this->setParentId($row->parent_id);
136 $this->setParentType($row->parent_type);
137 $this->setCatalog(ilUtil::stripSlashes($row->catalog));
138 $this->setEntry(ilUtil::stripSlashes($row->entry));
139 }
140 }
141 return true;
142 }
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(), setCatalog(), setEntry(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDIdentifier_::save ( )

Reimplemented from ilMDBase.

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

62 {
63 global $ilDB;
64
65 $fields = $this->__getFields();
66 $fields['meta_identifier__id'] = array('integer',$next_id = $ilDB->nextId('il_meta_identifier_'));
67
68 if($this->db->insert('il_meta_identifier_',$fields))
69 {
70 $this->setMetaId($next_id);
71 return $this->getMetaId();
72 }
73 return false;
74 }
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]

ilMDIdentifier_::save ( )

Reimplemented from ilMDBase.

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

62 {
63 if($this->db->autoExecute('il_meta_identifier_',
64 $this->__getFields(),
65 DB_AUTOQUERY_INSERT))
66 {
67 $this->setMetaId($this->db->getLastInsertId());
68
69 return $this->getMetaId();
70 }
71 return false;
72 }

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

+ Here is the call graph for this function:

◆ setCatalog() [1/2]

ilMDIdentifier_::setCatalog (   $a_catalog)

Definition at line 43 of file class.ilMDIdentifier_.php.

44 {
45 $this->catalog = $a_catalog;
46 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCatalog() [2/2]

ilMDIdentifier_::setCatalog (   $a_catalog)

Definition at line 43 of file class.ilMDIdentifier_.php.

44 {
45 $this->catalog = $a_catalog;
46 }

◆ setEntry() [1/2]

ilMDIdentifier_::setEntry (   $a_entry)

Definition at line 51 of file class.ilMDIdentifier_.php.

52 {
53 $this->entry = $a_entry;
54 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEntry() [2/2]

ilMDIdentifier_::setEntry (   $a_entry)

Definition at line 51 of file class.ilMDIdentifier_.php.

52 {
53 $this->entry = $a_entry;
54 }

◆ toXML() [1/2]

ilMDIdentifier_::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 147 of file class.ilMDIdentifier_.php.

148 {
149 $writer->xmlElement('Identifier_',array('Catalog' => $this->getCatalog(),
150 'Entry' => $this->getEntry() ? $this->getEntry() : "ID1"));
151 }

References getCatalog(), and getEntry().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDIdentifier_::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 149 of file class.ilMDIdentifier_.php.

150 {
151 $writer->xmlElement('Identifier_',array('Catalog' => $this->getCatalog(),
152 'Entry' => $this->getEntry()));
153 }

References getCatalog(), and getEntry().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDIdentifier_::update ( )

Reimplemented from ilMDBase.

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

77 {
78 global $ilDB;
79
80 if($this->getMetaId())
81 {
82 if($this->db->update('il_meta_identifier_',
83 $this->__getFields(),
84 array("meta_identifier__id" => array('integer',$this->getMetaId()))))
85 {
86 return true;
87 }
88 }
89 return false;
90 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDIdentifier_::update ( )

Reimplemented from ilMDBase.

Definition at line 74 of file class.ilMDIdentifier_.php.

75 {
76 global $ilDB;
77
78 if($this->getMetaId())
79 {
80 if($this->db->autoExecute('il_meta_identifier_',
81 $this->__getFields(),
82 DB_AUTOQUERY_UPDATE,
83 "meta_identifier__id = ".$ilDB->quote($this->getMetaId())))
84 {
85 return true;
86 }
87 }
88 return false;
89 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

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