ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMDOrComposite Class Reference
+ Inheritance diagram for ilMDOrComposite:
+ Collaboration diagram for ilMDOrComposite:

Public Member Functions

 setOrCompositeId ($a_or_composite_id)
 
 getOrCompositeId ()
 
getRequirementIds ()
 
getRequirement ($a_requirement_id)
 
addRequirement ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 
 setOrCompositeId ($a_or_composite_id)
 
 getOrCompositeId ()
 
getRequirementIds ()
 
getRequirement ($a_requirement_id)
 
addRequirement ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
- Public Member Functions inherited from ilMDRequirement
 setOrCompositeId ($a_or_composite_id)
 
 getOrCompositeId ()
 
 setOperatingSystemName ($a_val)
 
 getOperatingSystemName ()
 
 setOperatingSystemMinimumVersion ($a_val)
 
 getOperatingSystemMinimumVersion ()
 
 setOperatingSystemMaximumVersion ($a_val)
 
 getOperatingSystemMaximumVersion ()
 
 setBrowserName ($a_val)
 
 getBrowserName ()
 
 setBrowserMinimumVersion ($a_val)
 
 getBrowserMinimumVersion ()
 
 setBrowserMaximumVersion ($a_val)
 
 getBrowserMaximumVersion ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setOrCompositeId ($a_or_composite_id)
 
 getOrCompositeId ()
 
 setOperatingSystemName ($a_val)
 
 getOperatingSystemName ()
 
 setOperatingSystemMinimumVersion ($a_val)
 
 getOperatingSystemMinimumVersion ()
 
 setOperatingSystemMaximumVersion ($a_val)
 
 getOperatingSystemMaximumVersion ()
 
 setBrowserName ($a_val)
 
 getBrowserName ()
 
 setBrowserMinimumVersion ($a_val)
 
 getBrowserMinimumVersion ()
 
 setBrowserMaximumVersion ($a_val)
 
 getBrowserMaximumVersion ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type, $a_or_composite_id=0)
 
- 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, $a_parent_id, $a_parent_type, $a_or_composite_id=0)
 
- Static Public Member Functions inherited from ilMDRequirement
static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type, $a_or_composite_id=0)
 

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 35 of file class.ilMDOrComposite.php.

Member Function Documentation

◆ _getIds() [1/2]

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

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

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

137  {
138  global $ilDB;
139 
140  $query = "SELECT DISTINCT(or_composite_id) AS or_composite_id FROM il_meta_requirement " .
141  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
142  "AND obj_id = " . $ilDB->quote($a_obj_id) . " " .
143  "AND parent_id = " . $ilDB->quote($a_parent_id) . " " .
144  "AND parent_type = " . $ilDB->quote($a_parent_type) . " " .
145  "AND or_composite_id > 0 ";
146 
147  $res = $ilDB->query($query);
148  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
149  $ids[] = $row->or_composite_id;
150  }
151  return $ids ? $ids : array();
152  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ _getIds() [2/2]

static ilMDOrComposite::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type,
  $a_or_composite_id = 0 
)
static

Definition at line 141 of file class.ilMDOrComposite.php.

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

Referenced by ilMDTechnical\getOrCompositeIds().

142  {
143  global $ilDB;
144 
145  $query = "SELECT DISTINCT(or_composite_id) or_composite_id FROM il_meta_requirement " .
146  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
147  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
148  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
149  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text') . " " .
150  "AND or_composite_id > 0 ";
151 
152  $res = $ilDB->query($query);
153  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
154  $ids[] = $row->or_composite_id;
155  }
156  return $ids ? $ids : array();
157  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ addRequirement() [1/2]

& ilMDOrComposite::addRequirement ( )

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

References $req, ilMDBase\getObjId(), ilMDBase\getObjType(), getOrCompositeId(), ilMDBase\getParentId(), and ilMDBase\getRBACId().

87  {
88  include_once 'Services/MetaData/classes/class.ilMDRequirement.php';
89 
90  $req = new ilMDRequirement($this->getRBACId(), $this->getObjId(), $this->getObjType());
91  $req->setParentId($this->getParentId());
92  $req->setParentType('meta_technical');
93  $req->setOrCompositeId($this->getOrCompositeId());
94 
95  return $req;
96  }
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

◆ addRequirement() [2/2]

& ilMDOrComposite::addRequirement ( )

Definition at line 87 of file class.ilMDOrComposite.php.

References $req, ilMDBase\getObjId(), ilMDBase\getObjType(), getOrCompositeId(), ilMDBase\getParentId(), and ilMDBase\getRBACId().

88  {
89  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDRequirement.php';
90 
91  $req = new ilMDRequirement($this->getRBACId(), $this->getObjId(), $this->getObjType());
92  $req->setParentId($this->getParentId());
93  $req->setParentType('meta_technical');
94  $req->setOrCompositeId($this->getOrCompositeId());
95 
96  return $req;
97  }
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDOrComposite::delete ( )

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

References $id, $req, getRequirement(), and getRequirementIds().

108  {
109  foreach ($this->getRequirementIds() as $id) {
110  $req = $this->getRequirement($id);
111  $req->delete();
112  }
113  return true;
114  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getRequirement($a_requirement_id)
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDOrComposite::delete ( )

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

References $id, $req, getRequirement(), and getRequirementIds().

109  {
110  foreach ($this->getRequirementIds() as $id) {
111  $req = $this->getRequirement($id);
112  $req->delete();
113  }
114  return true;
115  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getRequirement($a_requirement_id)
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

◆ getOrCompositeId() [1/2]

ilMDOrComposite::getOrCompositeId ( )

Definition at line 42 of file class.ilMDOrComposite.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by addRequirement(), and getRequirementIds().

43  {
44  global $ilDB;
45 
46  if (!$this->or_composite_id) {
47  $query = "SELECT MAX(or_composite_id) orc FROM il_meta_requirement " .
48  "WHERE rbac_id = " . $ilDB->quote($this->getRBACId(), 'integer') . " " .
49  "AND obj_id = " . $ilDB->quote($this->getObjId(), 'integer') . " ";
50 
51  $res = $this->db->query($query);
52  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
53  $this->or_composite_id = $row->orc;
54  }
55  ++$this->or_composite_id;
56  }
57  return $this->or_composite_id;
58  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrCompositeId() [2/2]

ilMDOrComposite::getOrCompositeId ( )

Definition at line 42 of file class.ilMDOrComposite.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getObjId(), and ilMDBase\getRBACId().

43  {
44  global $ilDB;
45 
46  if (!$this->or_composite_id) {
47  $query = "SELECT MAX(or_composite_id) AS orc FROM il_meta_requirement " .
48  "WHERE rbac_id = " . $ilDB->quote($this->getRBACId()) . " " .
49  "AND obj_id = " . $ilDB->quote($this->getObjId()) . " " .
50  "GROUP BY or_composite_id";
51 
52  $res = $this->db->query($query);
53  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
54  $this->or_composite_id = $row->orc;
55  }
56  ++$this->or_composite_id;
57  }
58  return $this->or_composite_id;
59  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ getRequirement() [1/2]

& ilMDOrComposite::getRequirement (   $a_requirement_id)

Definition at line 73 of file class.ilMDOrComposite.php.

References $req.

Referenced by delete(), and toXML().

74  {
75  include_once 'Services/MetaData/classes/class.ilMDRequirement.php';
76 
77  if (!$a_requirement_id) {
78  return false;
79  }
80  $req = new ilMDRequirement();
81  $req->setMetaId($a_requirement_id);
82 
83  return $req;
84  }
$req
Definition: getUserInfo.php:20
+ Here is the caller graph for this function:

◆ getRequirement() [2/2]

& ilMDOrComposite::getRequirement (   $a_requirement_id)

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

References $req.

75  {
76  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDRequirement.php';
77 
78  if (!$a_requirement_id) {
79  return false;
80  }
81  $req = new ilMDRequirement();
82  $req->setMetaId($a_requirement_id);
83 
84  return $req;
85  }
$req
Definition: getUserInfo.php:20

◆ getRequirementIds() [1/2]

& ilMDOrComposite::getRequirementIds ( )

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

References ilMDRequirement\_getIds(), ilMDBase\getObjId(), getOrCompositeId(), ilMDBase\getParentId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

61  {
62  include_once 'Services/MetaData/classes/class.ilMDRequirement.php';
63 
65  $this->getRBACId(),
66  $this->getObjId(),
67  $this->getParentId(),
68  'meta_technical',
69  $this->getOrCompositeId()
70  );
71  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type, $a_or_composite_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRequirementIds() [2/2]

& ilMDOrComposite::getRequirementIds ( )

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

References ilMDRequirement\_getIds(), ilMDBase\getObjId(), getOrCompositeId(), ilMDBase\getParentId(), and ilMDBase\getRBACId().

62  {
63  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDRequirement.php';
64 
66  $this->getRBACId(),
67  $this->getObjId(),
68  $this->getParentId(),
69  'meta_technical',
70  $this->getOrCompositeId()
71  );
72  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type, $a_or_composite_id=0)
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDOrComposite::save ( )

Definition at line 102 of file class.ilMDOrComposite.php.

103  {
104  echo 'Use ilMDOrcomposite::addRequirement()';
105  }

◆ save() [2/2]

ilMDOrComposite::save ( )

Definition at line 103 of file class.ilMDOrComposite.php.

104  {
105  echo 'Use ilMDOrcomposite::addRequirement()';
106  }

◆ setOrCompositeId() [1/2]

ilMDOrComposite::setOrCompositeId (   $a_or_composite_id)

Definition at line 38 of file class.ilMDOrComposite.php.

39  {
40  $this->or_composite_id = (int) $a_or_composite_id;
41  }

◆ setOrCompositeId() [2/2]

ilMDOrComposite::setOrCompositeId (   $a_or_composite_id)

Definition at line 38 of file class.ilMDOrComposite.php.

39  {
40  $this->or_composite_id = (int) $a_or_composite_id;
41  }

◆ toXML() [1/2]

ilMDOrComposite::toXML ( $writer)

Definition at line 121 of file class.ilMDOrComposite.php.

References $id, $req, ilMDBase\getObjId(), ilMDBase\getRBACId(), getRequirement(), and getRequirementIds().

122  {
123  // For all requirements
124  $writer->xmlStartTag('OrComposite');
125 
126  $reqs = $this->getRequirementIds();
127  foreach ($reqs as $id) {
128  $req = $this->getRequirement($id);
129  $req->toXML($writer);
130  }
131  if (!count($reqs)) {
132  include_once 'Services/MetaData/classes/class.ilMDRequirement.php';
133  $req = new ilMDRequirement($this->getRBACId(), $this->getObjId());
134  $req->toXML($writer);
135  }
136  $writer->xmlEndTag('OrComposite');
137  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getRequirement($a_requirement_id)
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDOrComposite::toXML ( $writer)

Definition at line 122 of file class.ilMDOrComposite.php.

References $id, $req, getRequirement(), and getRequirementIds().

123  {
124  // For all requirements
125  $writer->xmlStartTag('OrComposite');
126 
127  foreach ($this->getRequirementIds() as $id) {
128  $req = $this->getRequirement($id);
129  $req->toXML($writer);
130  }
131  $writer->xmlEndTag('OrComposite');
132  }
if(!array_key_exists('StateId', $_REQUEST)) $id
& getRequirement($a_requirement_id)
$req
Definition: getUserInfo.php:20
+ Here is the call graph for this function:

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