57 public static function getInstance($a_server_id, $a_econtent_id, $a_resource_type)
63 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
64 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
66 $res = $connector->getResource($a_resource_type, $a_econtent_id,
true);
71 if(!is_object(
$res->getResult()))
73 $ilLog->write(__METHOD__ .
': Error parsing result. Expected result of type array.');
83 include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
84 $details =
new self();
85 $details->loadFromJSON(
$res->getResult());
103 return isset($this->senders[0]) ? $this->senders[0] : 0;
171 if(!is_object($json))
173 $ilLog->write(__METHOD__.
': Cannot load from JSON. No object given.');
174 throw new ilException(
'Cannot parse ECS content details.');
177 foreach((array) $json->senders as $sender)
179 $this->senders[] = $sender->mid;
183 foreach((array) $json->receivers as $receiver)
185 $this->receivers[] = $receiver->mid;
186 if($receiver->itsyou and $this->sender_index === NULL)
188 $this->sender_index = $index;
196 $this->receiver_info[$this->sender[$i]] = $this->receivers[$i];
199 if(is_object($json->owner))
201 $this->owner = (int) $json->owner->pid;
204 $this->url = $json->url;
205 $this->content_type = $json->content_type;