/** * Update application authentication token by id * * @action update * @param string $id * @param KalturaAppToken $appToken * @return KalturaAppToken * * @throws KalturaErrors::APP_TOKEN_ID_NOT_FOUND */ function updateAction($id, KalturaAppToken $appToken) { $dbAppToken = AppTokenPeer::retrieveByPK($id); if (!$dbAppToken) { throw new KalturaAPIException(KalturaErrors::APP_TOKEN_ID_NOT_FOUND, $id); } $appToken->toUpdatableObject($dbAppToken); $dbAppToken->save(); $appToken = new KalturaAppToken(); $appToken->fromObject($dbAppToken, $this->getResponseProfile()); return $appToken; }
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaAppTokenArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaAppToken(); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
/** * Update application authentication token by id * * @param string $id * @param KalturaAppToken $appToken * @return KalturaAppToken */ function update($id, KalturaAppToken $appToken) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "appToken", $appToken->toParams()); $this->client->queueServiceActionCall("apptoken", "update", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaAppToken"); return $resultObject; }