ILIAS  release_8 Revision v8.24
class.ilSoapStructureObjectFactory.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
31{
33 {
34 $classname = $this->_getClassnameForType($object->getType());
35 if ($classname !== null) {
36 switch ($object->getType()) {
37 case "lm":
38 case "glo":
39 return new $classname(
40 $object->getId(),
41 $object->getType(),
42 $object->getTitle(),
43 $object->getLongDescription(),
44 $object->getRefId()
45 );
46 }
47 }
48
49 return null;
50 }
51
52 public function getInstance(
53 int $objId,
54 string $type,
55 string $title,
56 string $description,
57 int $parentRefId
59 $classname = $this->_getClassnameForType($type);
60 if ($classname === null) {
61 return null;
62 }
63
64 return new $classname($objId, $type, $title, $description, $parentRefId);
65 }
66
67 public function _getClassnameForType(string $type) : ?string
68 {
69 switch ($type) {
70 case "glo":
71 case "lm":
72 include_once "./webservice/soap/classes/class.ilSoapRepositoryStructureObject.php";
73 return "ilSoapRepositoryStructureObject";
74 case "st":
75 include_once "./webservice/soap/classes/class.ilSoapLMChapterStructureObject.php";
76 return "ilSoapLMChapterStructureObject";
77 case "pg":
78 include_once "./webservice/soap/classes/class.ilSoapLMPageStructureObject.php";
79 return "ilSoapLMPageStructureObject";
80 case "git":
81 include_once "./webservice/soap/classes/class.ilSoapGLOTermStructureObject.php";
82 return "ilSoapGLOTermStructureObject";
83 case "gdf":
84 include_once "./webservice/soap/classes/class.ilSoapGLOTermDefinitionStructureObject.php";
85 return "ilSoapGLOTermDefinitionStructureObject";
86
87 }
88
89 return null;
90 }
91}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLongDescription()
get object long description (stored in object_description)
getInstance(int $objId, string $type, string $title, string $description, int $parentRefId)
Abstract classs for soap structure objects.
$type
$objId
Definition: xapitoken.php:57