ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSoapStructureObjectFactory.php
Go to the documentation of this file.
1<?php
25{
27 {
28 $classname = $this->_getClassnameForType($object->getType());
29 if ($classname !== null) {
30 switch ($object->getType()) {
31 case "lm":
32 case "glo":
33 return new $classname(
34 $object->getId(),
35 $object->getType(),
36 $object->getTitle(),
37 $object->getLongDescription(),
38 $object->getRefId()
39 );
40 }
41 }
42
43 return null;
44 }
45
46 public function getInstance(
47 int $objId,
48 string $type,
49 string $title,
50 string $description,
51 int $parentRefId
53 $classname = $this->_getClassnameForType($type);
54 if ($classname === null) {
55 return null;
56 }
57
58 return new $classname($objId, $type, $title, $description, $parentRefId);
59 }
60
61 public function _getClassnameForType(string $type): ?string
62 {
63 switch ($type) {
64 case "glo":
65 case "lm":
66 return "ilSoapRepositoryStructureObject";
67 case "st":
68 return "ilSoapLMChapterStructureObject";
69 case "pg":
70 return "ilSoapLMPageStructureObject";
71 case "git":
72 return "ilSoapGLOTermStructureObject";
73 case "term":
74 return "ilSoapGLOTermDefinitionStructureObject";
75 }
76
77 return null;
78 }
79}
Class ilObject Basic functions for all objects.
getLongDescription()
get object long description (stored in object_description)
getInstance(int $objId, string $type, string $title, string $description, int $parentRefId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$objId
Definition: xapitoken.php:57