ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMDLifecycle Class Reference
+ Inheritance diagram for ilMDLifecycle:
+ Collaboration diagram for ilMDLifecycle:

Public Member Functions

 getPossibleSubelements ()
 
getContributeIds ()
 
getContribute ($a_contribute_id)
 
addContribute ()
 
 setStatus ($a_status)
 
 getStatus ()
 
 setVersion ($a_version)
 
 getVersion ()
 
 setVersionLanguage ($lng_obj)
 
getVersionLanguage ()
 
 getVersionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
getContributeIds ()
 
getContribute ($a_contribute_id)
 
addContribute ()
 
 setStatus ($a_status)
 
 getStatus ()
 
 setVersion ($a_version)
 
 getVersion ()
 
 setVersionLanguage ($lng_obj)
 
getVersionLanguage ()
 
 getVersionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getId ($a_rbac_id, $a_obj_id)
 
 getPossibleSubelements ()
 
getContributeIds ()
 
getContribute ($a_contribute_id)
 
addContribute ()
 
 setStatus ($a_status)
 
 getStatus ()
 
 setVersion ($a_version)
 
 getVersion ()
 
 setVersionLanguage ($lng_obj)
 
getVersionLanguage ()
 
 getVersionLanguageCode ()
 
 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 _getId ($a_rbac_id, $a_obj_id)
 
static _getId ($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.ilMDLifecycle.php.

Member Function Documentation

◆ __getFields() [1/3]

ilMDLifecycle::__getFields ( )

Definition at line 166 of file class.ilMDLifecycle.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStatus(), getVersion(), getVersionLanguageCode(), and ilUtil\prepareDBString().

167  {
168  return array('rbac_id' => $this->getRBACId(),
169  'obj_id' => $this->getObjId(),
170  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
171  'lifecycle_status' => ilUtil::prepareDBString($this->getStatus()),
172  'meta_version' => ilUtil::prepareDBString($this->getVersion()),
173  'version_language' => ilUtil::prepareDBString($this->getVersionLanguageCode()));
174  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDLifecycle::__getFields ( )

Definition at line 176 of file class.ilMDLifecycle.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStatus(), getVersion(), and getVersionLanguageCode().

Referenced by save().

177  {
178  return array('rbac_id' => array('integer',$this->getRBACId()),
179  'obj_id' => array('integer',$this->getObjId()),
180  'obj_type' => array('text',$this->getObjType()),
181  'lifecycle_status' => array('text',$this->getStatus()),
182  'meta_version' => array('text',$this->getVersion()),
183  'version_language' => array('text',$this->getVersionLanguageCode()));
184  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [3/3]

ilMDLifecycle::__getFields ( )

Definition at line 176 of file class.ilMDLifecycle.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStatus(), getVersion(), and getVersionLanguageCode().

177  {
178  return array('rbac_id' => array('integer',$this->getRBACId()),
179  'obj_id' => array('integer',$this->getObjId()),
180  'obj_type' => array('text',$this->getObjType()),
181  'lifecycle_status' => array('text',$this->getStatus()),
182  'meta_version' => array('text',$this->getVersion()),
183  'version_language' => array('text',$this->getVersionLanguageCode()));
184  }
+ Here is the call graph for this function:

◆ _getId() [1/3]

ilMDLifecycle::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 221 of file class.ilMDLifecycle.php.

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

222  {
223  global $ilDB;
224 
225  $query = "SELECT meta_lifecycle_id FROM il_meta_lifecycle " .
226  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
227  "AND obj_id = " . $ilDB->quote($a_obj_id);
228 
229 
230  $res = $ilDB->query($query);
231  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
232  return $row->meta_lifecycle_id;
233  }
234  return false;
235  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getId() [2/3]

static ilMDLifecycle::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 246 of file class.ilMDLifecycle.php.

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

Referenced by ilMD\getLifecycle().

247  {
248  global $DIC;
249 
250  $ilDB = $DIC['ilDB'];
251 
252  $query = "SELECT meta_lifecycle_id FROM il_meta_lifecycle " .
253  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
254  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
255 
256 
257  $res = $ilDB->query($query);
258  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
259  return $row->meta_lifecycle_id;
260  }
261  return false;
262  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getId() [3/3]

static ilMDLifecycle::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 246 of file class.ilMDLifecycle.php.

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

247  {
248  global $DIC;
249 
250  $ilDB = $DIC['ilDB'];
251 
252  $query = "SELECT meta_lifecycle_id FROM il_meta_lifecycle " .
253  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
254  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
255 
256 
257  $res = $ilDB->query($query);
258  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
259  return $row->meta_lifecycle_id;
260  }
261  return false;
262  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ addContribute() [1/3]

& ilMDLifecycle::addContribute ( )

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

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

56  {
57  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDContribute.php';
58 
59  $con = new ilMDContribute($this->getRBACId(), $this->getObjId(), $this->getObjType());
60  $con->setParentId($this->getMetaId());
61  $con->setParentType('meta_lifecycle');
62 
63  return $con;
64  }
+ Here is the call graph for this function:

◆ addContribute() [2/3]

& ilMDLifecycle::addContribute ( )

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

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

63  {
64  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDContribute.php';
65 
66  $con = new ilMDContribute($this->getRBACId(), $this->getObjId(), $this->getObjType());
67  $con->setParentId($this->getMetaId());
68  $con->setParentType('meta_lifecycle');
69 
70  return $con;
71  }
+ Here is the call graph for this function:

◆ addContribute() [3/3]

& ilMDLifecycle::addContribute ( )

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

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

63  {
64  include_once 'Services/MetaData/classes/class.ilMDContribute.php';
65 
66  $con = new ilMDContribute($this->getRBACId(), $this->getObjId(), $this->getObjType());
67  $con->setParentId($this->getMetaId());
68  $con->setParentType('meta_lifecycle');
69 
70  return $con;
71  }
+ Here is the call graph for this function:

◆ delete() [1/3]

ilMDLifecycle::delete ( )

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

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

144  {
145  global $ilDB;
146 
147  // Delete 'contribute'
148  foreach ($this->getContributeIds() as $id) {
149  $con = $this->getContribute($id);
150  $con->delete();
151  }
152 
153 
154  if ($this->getMetaId()) {
155  $query = "DELETE FROM il_meta_lifecycle " .
156  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId());
157 
158  $this->db->query($query);
159 
160  return true;
161  }
162  return false;
163  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDLifecycle::delete ( )

Definition at line 153 of file class.ilMDLifecycle.php.

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

154  {
155  global $DIC;
156 
157  $ilDB = $DIC['ilDB'];
158 
159  // Delete 'contribute'
160  foreach ($this->getContributeIds() as $id) {
161  $con = $this->getContribute($id);
162  $con->delete();
163  }
164 
165 
166  if ($this->getMetaId()) {
167  $query = "DELETE FROM il_meta_lifecycle " .
168  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId(), 'integer');
169  $res = $ilDB->manipulate($query);
170  return true;
171  }
172  return false;
173  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDLifecycle::delete ( )

Definition at line 153 of file class.ilMDLifecycle.php.

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

154  {
155  global $DIC;
156 
157  $ilDB = $DIC['ilDB'];
158 
159  // Delete 'contribute'
160  foreach ($this->getContributeIds() as $id) {
161  $con = $this->getContribute($id);
162  $con->delete();
163  }
164 
165 
166  if ($this->getMetaId()) {
167  $query = "DELETE FROM il_meta_lifecycle " .
168  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId(), 'integer');
169  $res = $ilDB->manipulate($query);
170  return true;
171  }
172  return false;
173  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ getContribute() [1/3]

& ilMDLifecycle::getContribute (   $a_contribute_id)

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

44  {
45  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDContribute.php';
46 
47  if (!$a_contribute_id) {
48  return false;
49  }
50  $con = new ilMDContribute();
51  $con->setMetaId($a_contribute_id);
52 
53  return $con;
54  }

◆ getContribute() [2/3]

& ilMDLifecycle::getContribute (   $a_contribute_id)

Definition at line 50 of file class.ilMDLifecycle.php.

Referenced by delete(), and toXML().

51  {
52  include_once 'Services/MetaData/classes/class.ilMDContribute.php';
53 
54  if (!$a_contribute_id) {
55  return false;
56  }
57  $con = new ilMDContribute();
58  $con->setMetaId($a_contribute_id);
59 
60  return $con;
61  }
+ Here is the caller graph for this function:

◆ getContribute() [3/3]

& ilMDLifecycle::getContribute (   $a_contribute_id)

Definition at line 50 of file class.ilMDLifecycle.php.

51  {
52  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDContribute.php';
53 
54  if (!$a_contribute_id) {
55  return false;
56  }
57  $con = new ilMDContribute();
58  $con->setMetaId($a_contribute_id);
59 
60  return $con;
61  }

◆ getContributeIds() [1/3]

& ilMDLifecycle::getContributeIds ( )

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

References ilMDContribute\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

38  {
39  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDContribute.php';
40 
41  return ilMDContribute::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_lifecycle');
42  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getContributeIds() [2/3]

& ilMDLifecycle::getContributeIds ( )

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

References ilMDContribute\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

45  {
46  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDContribute.php';
47 
48  return ilMDContribute::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_lifecycle');
49  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getContributeIds() [3/3]

& ilMDLifecycle::getContributeIds ( )

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

References ilMDContribute\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

45  {
46  include_once 'Services/MetaData/classes/class.ilMDContribute.php';
47 
48  return ilMDContribute::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_lifecycle');
49  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleSubelements() [1/2]

ilMDLifecycle::getPossibleSubelements ( )

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

37  {
38  $subs['Contribute'] = 'meta_contribute';
39 
40  return $subs;
41  }

◆ getPossibleSubelements() [2/2]

ilMDLifecycle::getPossibleSubelements ( )

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

37  {
38  $subs['Contribute'] = 'meta_contribute';
39 
40  return $subs;
41  }

◆ getStatus() [1/3]

ilMDLifecycle::getStatus ( )

Definition at line 82 of file class.ilMDLifecycle.php.

83  {
84  return $this->status;
85  }

◆ getStatus() [2/3]

ilMDLifecycle::getStatus ( )

Definition at line 89 of file class.ilMDLifecycle.php.

90  {
91  return $this->status;
92  }

◆ getStatus() [3/3]

ilMDLifecycle::getStatus ( )

Definition at line 89 of file class.ilMDLifecycle.php.

Referenced by __getFields(), and toXML().

90  {
91  return $this->status;
92  }
+ Here is the caller graph for this function:

◆ getVersion() [1/3]

ilMDLifecycle::getVersion ( )

Definition at line 90 of file class.ilMDLifecycle.php.

References $version.

91  {
92  return $this->version;
93  }
$version
Definition: build.php:27

◆ getVersion() [2/3]

ilMDLifecycle::getVersion ( )

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

References $version.

Referenced by __getFields(), and toXML().

98  {
99  return $this->version;
100  }
$version
Definition: build.php:27
+ Here is the caller graph for this function:

◆ getVersion() [3/3]

ilMDLifecycle::getVersion ( )

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

References $version.

98  {
99  return $this->version;
100  }
$version
Definition: build.php:27

◆ getVersionLanguage() [1/3]

& ilMDLifecycle::getVersionLanguage ( )

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

101  {
102  return $this->version_language;
103  }

◆ getVersionLanguage() [2/3]

& ilMDLifecycle::getVersionLanguage ( )

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

108  {
109  return $this->version_language;
110  }

◆ getVersionLanguage() [3/3]

& ilMDLifecycle::getVersionLanguage ( )

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

108  {
109  return $this->version_language;
110  }

◆ getVersionLanguageCode() [1/3]

ilMDLifecycle::getVersionLanguageCode ( )

Definition at line 104 of file class.ilMDLifecycle.php.

105  {
106  if (is_object($this->version_language)) {
107  return $this->version_language->getLanguageCode();
108  }
109  return false;
110  }

◆ getVersionLanguageCode() [2/3]

ilMDLifecycle::getVersionLanguageCode ( )

Definition at line 111 of file class.ilMDLifecycle.php.

Referenced by __getFields(), and toXML().

112  {
113  if (is_object($this->version_language)) {
114  return $this->version_language->getLanguageCode();
115  }
116  return false;
117  }
+ Here is the caller graph for this function:

◆ getVersionLanguageCode() [3/3]

ilMDLifecycle::getVersionLanguageCode ( )

Definition at line 111 of file class.ilMDLifecycle.php.

112  {
113  if (is_object($this->version_language)) {
114  return $this->version_language->getLanguageCode();
115  }
116  return false;
117  }

◆ read() [1/3]

ilMDLifecycle::read ( )

Definition at line 176 of file class.ilMDLifecycle.php.

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

177  {
178  global $ilDB;
179 
180  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
181 
182  if ($this->getMetaId()) {
183  $query = "SELECT * FROM il_meta_lifecycle " .
184  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId());
185 
186  $res = $this->db->query($query);
187  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188  $this->setRBACId($row->rbac_id);
189  $this->setObjId($row->obj_id);
190  $this->setObjType($row->obj_type);
191  $this->setStatus(ilUtil::stripSlashes($row->lifecycle_status));
192  $this->setVersion(ilUtil::stripSlashes($row->meta_version));
193  $this->setVersionLanguage(new ilMDLanguageItem($row->version_language));
194  }
195  }
196  return true;
197  }
setObjType($a_type)
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
setVersion($a_version)
global $ilDB
setVersionLanguage($lng_obj)
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDLifecycle::read ( )

Definition at line 186 of file class.ilMDLifecycle.php.

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

187  {
188  global $DIC;
189 
190  $ilDB = $DIC['ilDB'];
191 
192  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
193 
194  if ($this->getMetaId()) {
195  $query = "SELECT * FROM il_meta_lifecycle " .
196  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId(), 'integer');
197 
198  $res = $this->db->query($query);
199  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
200  $this->setRBACId($row->rbac_id);
201  $this->setObjId($row->obj_id);
202  $this->setObjType($row->obj_type);
203  $this->setStatus($row->lifecycle_status);
204  $this->setVersion($row->meta_version);
205  $this->setVersionLanguage(new ilMDLanguageItem($row->version_language));
206  }
207  }
208  return true;
209  }
setObjType($a_type)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
$row
setVersion($a_version)
global $ilDB
setVersionLanguage($lng_obj)
+ Here is the call graph for this function:

◆ read() [3/3]

ilMDLifecycle::read ( )

Definition at line 186 of file class.ilMDLifecycle.php.

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

187  {
188  global $DIC;
189 
190  $ilDB = $DIC['ilDB'];
191 
192  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
193 
194  if ($this->getMetaId()) {
195  $query = "SELECT * FROM il_meta_lifecycle " .
196  "WHERE meta_lifecycle_id = " . $ilDB->quote($this->getMetaId(), 'integer');
197 
198  $res = $this->db->query($query);
199  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
200  $this->setRBACId($row->rbac_id);
201  $this->setObjId($row->obj_id);
202  $this->setObjType($row->obj_type);
203  $this->setStatus($row->lifecycle_status);
204  $this->setVersion($row->meta_version);
205  $this->setVersionLanguage(new ilMDLanguageItem($row->version_language));
206  }
207  }
208  return true;
209  }
setObjType($a_type)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
$row
setVersion($a_version)
global $ilDB
setVersionLanguage($lng_obj)
+ Here is the call graph for this function:

◆ save() [1/3]

ilMDLifecycle::save ( )

Definition at line 112 of file class.ilMDLifecycle.php.

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

113  {
114  if ($this->db->autoExecute(
115  'il_meta_lifecycle',
116  $this->__getFields(),
118  )) {
119  $this->setMetaId($this->db->getLastInsertId());
120 
121  return $this->getMetaId();
122  }
123  return false;
124  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/3]

ilMDLifecycle::save ( )

Definition at line 119 of file class.ilMDLifecycle.php.

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

120  {
121  global $DIC;
122 
123  $ilDB = $DIC['ilDB'];
124 
125  $fields = $this->__getFields();
126  $fields['meta_lifecycle_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_lifecycle'));
127 
128  if ($this->db->insert('il_meta_lifecycle', $fields)) {
129  $this->setMetaId($next_id);
130  return $this->getMetaId();
131  }
132  return false;
133  }
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]

ilMDLifecycle::save ( )

Definition at line 119 of file class.ilMDLifecycle.php.

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

120  {
121  global $DIC;
122 
123  $ilDB = $DIC['ilDB'];
124 
125  $fields = $this->__getFields();
126  $fields['meta_lifecycle_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_lifecycle'));
127 
128  if ($this->db->insert('il_meta_lifecycle', $fields)) {
129  $this->setMetaId($next_id);
130  return $this->getMetaId();
131  }
132  return false;
133  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setStatus() [1/3]

ilMDLifecycle::setStatus (   $a_status)

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

69  {
70  switch ($a_status) {
71  case 'Draft':
72  case 'Final':
73  case 'Revised':
74  case 'Unavailable':
75  $this->status = $a_status;
76 
77  // no break
78  default:
79  return false;
80  }
81  }

◆ setStatus() [2/3]

ilMDLifecycle::setStatus (   $a_status)

Definition at line 75 of file class.ilMDLifecycle.php.

76  {
77  switch ($a_status) {
78  case 'Draft':
79  case 'Final':
80  case 'Revised':
81  case 'Unavailable':
82  $this->status = $a_status;
83 
84  // no break
85  default:
86  return false;
87  }
88  }

◆ setStatus() [3/3]

ilMDLifecycle::setStatus (   $a_status)

Definition at line 75 of file class.ilMDLifecycle.php.

Referenced by read().

76  {
77  switch ($a_status) {
78  case 'Draft':
79  case 'Final':
80  case 'Revised':
81  case 'Unavailable':
82  $this->status = $a_status;
83 
84  // no break
85  default:
86  return false;
87  }
88  }
+ Here is the caller graph for this function:

◆ setVersion() [1/3]

ilMDLifecycle::setVersion (   $a_version)

Definition at line 86 of file class.ilMDLifecycle.php.

87  {
88  $this->version = $a_version;
89  }

◆ setVersion() [2/3]

ilMDLifecycle::setVersion (   $a_version)

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

94  {
95  $this->version = $a_version;
96  }

◆ setVersion() [3/3]

ilMDLifecycle::setVersion (   $a_version)

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

Referenced by read().

94  {
95  $this->version = $a_version;
96  }
+ Here is the caller graph for this function:

◆ setVersionLanguage() [1/3]

ilMDLifecycle::setVersionLanguage (   $lng_obj)

Definition at line 94 of file class.ilMDLifecycle.php.

95  {
96  if (is_object($lng_obj)) {
97  $this->version_language = &$lng_obj;
98  }
99  }

◆ setVersionLanguage() [2/3]

ilMDLifecycle::setVersionLanguage (   $lng_obj)

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

102  {
103  if (is_object($lng_obj)) {
104  $this->version_language = &$lng_obj;
105  }
106  }

◆ setVersionLanguage() [3/3]

ilMDLifecycle::setVersionLanguage (   $lng_obj)

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

Referenced by read().

102  {
103  if (is_object($lng_obj)) {
104  $this->version_language = &$lng_obj;
105  }
106  }
+ Here is the caller graph for this function:

◆ toXML() [1/3]

ilMDLifecycle::toXML ( $writer)

Definition at line 204 of file class.ilMDLifecycle.php.

References $id, getContribute(), getContributeIds(), getStatus(), getVersion(), and getVersionLanguageCode().

205  {
206  $writer->xmlStartTag('Lifecycle', array('Status' => $this->getStatus()));
207  $writer->xmlElement('Version', array('Language' => $this->getVersionLanguageCode()), $this->getVersion());
208 
209  // contribute
210  foreach ($this->getContributeIds() as $id) {
211  $con = &$this->getContribute($id);
212  $con->toXML($writer);
213  }
214 
215  $writer->xmlEndTag('Lifecycle');
216  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDLifecycle::toXML ( $writer)

Definition at line 216 of file class.ilMDLifecycle.php.

References $id, getContribute(), getContributeIds(), ilMDBase\getObjId(), ilMDBase\getRBACId(), getStatus(), getVersion(), and getVersionLanguageCode().

217  {
218  $writer->xmlStartTag('Lifecycle', array('Status' => $this->getStatus()
219  ? $this->getStatus()
220  : 'Draft'));
221  $writer->xmlElement(
222  'Version',
223  array('Language' => $this->getVersionLanguageCode()
224  ? $this->getVersionLanguageCode()
225  : 'en'),
226  $this->getVersion()
227  );
228 
229  // contribute
230  $contributes = $this->getContributeIds();
231  foreach ($contributes as $id) {
232  $con = &$this->getContribute($id);
233  $con->toXML($writer);
234  }
235  if (!count($contributes)) {
236  include_once 'Services/MetaData/classes/class.ilMDContribute.php';
237  $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
238  $con->toXML($writer);
239  }
240  $writer->xmlEndTag('Lifecycle');
241  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDLifecycle::toXML ( $writer)

Definition at line 216 of file class.ilMDLifecycle.php.

References $id, getContribute(), getContributeIds(), ilMDBase\getObjId(), ilMDBase\getRBACId(), getStatus(), getVersion(), and getVersionLanguageCode().

217  {
218  $writer->xmlStartTag('Lifecycle', array('Status' => $this->getStatus()
219  ? $this->getStatus()
220  : 'Draft'));
221  $writer->xmlElement(
222  'Version',
223  array('Language' => $this->getVersionLanguageCode()
224  ? $this->getVersionLanguageCode()
225  : 'en'),
226  $this->getVersion()
227  );
228 
229  // contribute
230  $contributes = $this->getContributeIds();
231  foreach ($contributes as $id) {
232  $con = &$this->getContribute($id);
233  $con->toXML($writer);
234  }
235  if (!count($contributes)) {
236  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDContribute.php';
237  $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
238  $con->toXML($writer);
239  }
240  $writer->xmlEndTag('Lifecycle');
241  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getContribute($a_contribute_id)
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDLifecycle::update ( )

Definition at line 126 of file class.ilMDLifecycle.php.

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

127  {
128  global $ilDB;
129 
130  if ($this->getMetaId()) {
131  if ($this->db->autoExecute(
132  'il_meta_lifecycle',
133  $this->__getFields(),
135  "meta_lifecycle_id = " . $ilDB->quote($this->getMetaId())
136  )) {
137  return true;
138  }
139  }
140  return false;
141  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/3]

ilMDLifecycle::update ( )

Definition at line 135 of file class.ilMDLifecycle.php.

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

136  {
137  global $DIC;
138 
139  $ilDB = $DIC['ilDB'];
140 
141  if ($this->getMetaId()) {
142  if ($this->db->update(
143  'il_meta_lifecycle',
144  $this->__getFields(),
145  array("meta_lifecycle_id" => array('integer',$this->getMetaId()))
146  )) {
147  return true;
148  }
149  }
150  return false;
151  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDLifecycle::update ( )

Definition at line 135 of file class.ilMDLifecycle.php.

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

136  {
137  global $DIC;
138 
139  $ilDB = $DIC['ilDB'];
140 
141  if ($this->getMetaId()) {
142  if ($this->db->update(
143  'il_meta_lifecycle',
144  $this->__getFields(),
145  array("meta_lifecycle_id" => array('integer',$this->getMetaId()))
146  )) {
147  return true;
148  }
149  }
150  return false;
151  }
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: