public function toObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new QuizUserEntry(); } return parent::toObject($object_to_fill, $props_to_skip); }
public static function fromDbArray(array $arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaUserEntryArray(); foreach ($arr as $obj) { /* @var $obj UserEntry */ $nObj = KalturaUserEntry::getInstanceByType($obj->getType()); if (!$nObj) { throw new KalturaAPIException(KalturaErrors::USER_ENTRY_OBJECT_TYPE_ERROR, $obj->getType(), $obj->getId()); } $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
/** * @action get * @param string $id * @return KalturaUserEntry * @throws KalturaAPIException */ public function getAction($id) { $dbUserEntry = UserEntryPeer::retrieveByPK($id); if (!$dbUserEntry) { throw new KalturaAPIException(KalturaErrors::USER_ENTRY_NOT_FOUND, $id); } $userEntry = KalturaUserEntry::getInstanceByType($dbUserEntry->getType()); if (!$userEntry) { return null; } $userEntry->fromObject($dbUserEntry); return $userEntry; }
/** * * * @param int $id * @param KalturaUserEntry $userEntry * @return */ function update($id, KalturaUserEntry $userEntry) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "userEntry", $userEntry->toParams()); $this->client->queueServiceActionCall("userentry", "update", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "null"); return $resultObject; }