ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
24 
35  function getInstanceForObject ($object)
36  {
37  $classname = ilSoapStructureObjectFactory::_getClassnameForType ($object->getType());
38 
39  if ($classname != null)
40  switch ($object->getType())
41  {
42  case "lm":
43  case "glo":
44  return new $classname(
45  $object->getId(), $object->getType(), $object->getTitle(),
46  $object->getLongDescription(), $object->getRefId());
47  break;
48  }
49  return null;
50  }
51 
52  function getInstance ($objId, $type, $title, $description, $parentRefId)
53  {
55  if ($classname == null)
56  return null;
57 
58  return new $classname($objId, $type, $title, $description, $parentRefId);
59  }
60 
62  {
63  switch ($type)
64  {
65  case "lm":
66  include_once "./webservice/soap/classes/class.ilSoapRepositoryStructureObject.php";
67  return "ilSoapRepositoryStructureObject";
68  case "st":
69  include_once "./webservice/soap/classes/class.ilSoapLMChapterStructureObject.php";
70  return "ilSoapLMChapterStructureObject";
71  case "pg":
72  include_once "./webservice/soap/classes/class.ilSoapLMPageStructureObject.php";
73  return "ilSoapLMPageStructureObject";
74  case "glo":
75  include_once "./webservice/soap/classes/class.ilSoapRepositoryStructureObject.php";
76  return "ilSoapRepositoryStructureObject";
77  case "git":
78  include_once "./webservice/soap/classes/class.ilSoapGLOTermStructureObject.php";
79  return "ilSoapGLOTermStructureObject";
80  case "gdf":
81  include_once "./webservice/soap/classes/class.ilSoapGLOTermDefinitionStructureObject.php";
82  return "ilSoapGLOTermDefinitionStructureObject";
83 
84 
85  }
86  return null;
87  }
88 }
89 
90 ?>