Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 class ilSoapStructureObjectFactory {
00035 function getInstanceForObject ($object)
00036 {
00037 $classname = ilSoapStructureObjectFactory::_getClassnameForType ($object->getType());
00038
00039 if ($classname != null)
00040 switch ($object->getType())
00041 {
00042 case "lm":
00043 case "glo":
00044 return new $classname(
00045 $object->getId(), $object->getType(), $object->getTitle(),
00046 $object->getLongDescription(), $object->getRefId());
00047 break;
00048 }
00049 return null;
00050 }
00051
00052 function getInstance ($objId, $type, $title, $description, $parentRefId)
00053 {
00054 $classname = ilSoapStructureObjectFactory::_getClassnameForType ($type);
00055 if ($classname == null)
00056 return null;
00057
00058 return new $classname($objId, $type, $title, $description, $parentRefId);
00059 }
00060
00061 function _getClassnameForType ($type)
00062 {
00063 switch ($type)
00064 {
00065 case "lm":
00066 include_once "./webservice/soap/classes/class.ilSoapRepositoryStructureObject.php";
00067 return "ilSoapRepositoryStructureObject";
00068 case "st":
00069 include_once "./webservice/soap/classes/class.ilSoapLMChapterStructureObject.php";
00070 return "ilSoapLMChapterStructureObject";
00071 case "pg":
00072 include_once "./webservice/soap/classes/class.ilSoapLMPageStructureObject.php";
00073 return "ilSoapLMPageStructureObject";
00074 case "glo":
00075 include_once "./webservice/soap/classes/class.ilSoapRepositoryStructureObject.php";
00076 return "ilSoapRepositoryStructureObject";
00077 case "git":
00078 include_once "./webservice/soap/classes/class.ilSoapGLOTermStructureObject.php";
00079 return "ilSoapGLOTermStructureObject";
00080 case "gdf":
00081 include_once "./webservice/soap/classes/class.ilSoapGLOTermDefinitionStructureObject.php";
00082 return "ilSoapGLOTermDefinitionStructureObject";
00083
00084
00085 }
00086 return null;
00087 }
00088 }
00089
00090 ?>