ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMDFactory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 /*
5  +-----------------------------------------------------------------------------+
6  | ILIAS open source |
7  +-----------------------------------------------------------------------------+
8  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
9  | |
10  | This program is free software; you can redistribute it and/or |
11  | modify it under the terms of the GNU General Public License |
12  | as published by the Free Software Foundation; either version 2 |
13  | of the License, or (at your option) any later version. |
14  | |
15  | This program is distributed in the hope that it will be useful, |
16  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18  | GNU General Public License for more details. |
19  | |
20  | You should have received a copy of the GNU General Public License |
21  | along with this program; if not, write to the Free Software |
22  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23  +-----------------------------------------------------------------------------+
24 */
25 
32 {
36  public static function _getInstance(string $a_type, int $a_index, ?int $a_technical_id = 0): ?object
37  {
38  switch ($a_type) {
39  case 'meta_technical':
40 
41  $tec = new ilMDTechnical();
42  $tec->setMetaId($a_index);
43 
44  return $tec;
45 
46  case 'meta_or_composite':
47 
48  $tec = new ilMDTechnical();
49  $tec->setMetaId($a_technical_id);
50 
51  return $tec->getOrComposite($a_index);
52 
53  case 'meta_requirement':
54 
55  $req = new ilMDRequirement();
56  $req->setMetaId($a_index);
57 
58  return $req;
59 
60  case 'meta_location':
61 
62  $loc = new ilMDLocation();
63  $loc->setMetaId($a_index);
64 
65  return $loc;
66 
67  case 'meta_format':
68 
69  $for = new ilMDFormat();
70  $for->setMetaId($a_index);
71 
72  return $for;
73 
74  case 'meta_lifecycle':
75 
76  $lif = new ilMDLifecycle();
77  $lif->setMetaId($a_index);
78 
79  return $lif;
80 
81  case 'meta_entity':
82 
83  $ent = new ilMDEntity();
84  $ent->setMetaId($a_index);
85 
86  return $ent;
87 
88  case 'meta_contribute':
89 
90  $con = new ilMDContribute();
91  $con->setMetaId($a_index);
92 
93  return $con;
94 
95  case 'meta_identifier':
96 
97  $ide = new ilMDIdentifier();
98  $ide->setMetaId($a_index);
99 
100  return $ide;
101 
102  case 'educational_description':
103  case 'meta_description':
104 
105  $des = new ilMDDescription();
106  $des->setMetaId($a_index);
107 
108  return $des;
109 
110  case 'meta_keyword':
111  case 'classification_keyword':
112 
113  $key = new ilMDKeyword();
114  $key->setMetaId($a_index);
115 
116  return $key;
117 
118  case 'educational_language':
119  case 'meta_language':
120 
121  $lan = new ilMDLanguage();
122  $lan->setMetaId($a_index);
123 
124  return $lan;
125 
126  case 'meta_rights':
127 
128  $rights = new ilMDRights();
129  $rights->setMetaId($a_index);
130  return $rights;
131 
132  case 'meta_educational':
133 
134  $edu = new ilMDEducational();
135  $edu->setMetaId($a_index);
136  return $edu;
137 
138  case 'educational_typical_age_range':
139 
140  $age = new ilMDTypicalAgeRange();
141  $age->setMetaId($a_index);
142  return $age;
143 
144  case 'meta_relation':
145 
146  $relation = new ilMDRelation();
147  $relation->setMetaId($a_index);
148  return $relation;
149 
150  case 'relation_resource_identifier':
151 
152  $ide = new ilMDIdentifier_();
153  $ide->setMetaId($a_index);
154 
155  return $ide;
156 
157  case 'relation_resource_description':
158 
159  $des = new ilMDDescription();
160  $des->setMetaId($a_index);
161 
162  return $des;
163 
164  case 'meta_annotation':
165 
166  $anno = new ilMDAnnotation();
167  $anno->setMetaId($a_index);
168  return $anno;
169 
170  case 'meta_classification':
171 
172  $class = new ilMDClassification();
173  $class->setMetaId($a_index);
174  return $class;
175 
176  case 'classification_taxon_path':
177 
178  $tax_path = new ilMDTaxonPath();
179 
180  $tax_path->setMetaId($a_index);
181  return $tax_path;
182 
183  case 'classification_taxon':
184 
185  $tax = new ilMDTaxon();
186  $tax->setMetaId($a_index);
187  return $tax;
188 
189  case 'meta_meta_metadata':
190 
191  $met = new ilMDMetaMetadata();
192  $met->setMetaId($a_index);
193  return $met;
194 
195  default:
196  echo $a_type . " not known";
197  return null;
198  }
199  }
200 }
catch(\Exception $e) $req
Definition: xapiproxy.php:93
string $key
Consumer key/client ID value.
Definition: System.php:193
static _getInstance(string $a_type, int $a_index, ?int $a_technical_id=0)