/** * Delete response profile by id * * @action delete * @param int $id * * @throws KalturaErrors::RESPONSE_PROFILE_ID_NOT_FOUND */ function deleteAction($id) { $dbResponseProfile = ResponseProfilePeer::retrieveByPK($id); if (!$dbResponseProfile) { throw new KalturaAPIException(KalturaErrors::RESPONSE_PROFILE_ID_NOT_FOUND, $id); } $dbResponseProfile->setStatus(ResponseProfileStatus::DELETED); $dbResponseProfile->save(); }
/** * @return KalturaDetachedResponseProfile */ public function getResponseProfile($paramName = 'responseProfile') { if (!isset($this->paramsGrouped[$paramName])) { return null; } $responseProfile = null; if (isset($this->paramsGrouped[$paramName]['id'])) { $responseProfile = ResponseProfilePeer::retrieveByPK($this->paramsGrouped[$paramName]['id']); } if (isset($this->paramsGrouped[$paramName]['systemName'])) { $responseProfile = ResponseProfilePeer::retrieveBySystemName($this->paramsGrouped[$paramName]['systemName']); } if ($responseProfile) { return new KalturaResponseProfile($responseProfile); } $typeReflector = KalturaTypeReflectorCacher::get('KalturaDetachedResponseProfile'); return $this->buildObject($typeReflector, $this->paramsGrouped[$paramName], $paramName); }
/** * @return KalturaDetachedResponseProfile */ public function getResponseProfile($paramName = 'responseProfile') { if (!isset($this->paramsGrouped[$paramName])) { return null; } $partnerId = kCurrentContext::getCurrentPartnerId(); myPartnerUtils::addPartnerToCriteria('ResponseProfile', $partnerId, true, "{$partnerId},0"); $responseProfile = null; if (isset($this->paramsGrouped[$paramName]['id'])) { $responseProfile = ResponseProfilePeer::retrieveByPK($this->paramsGrouped[$paramName]['id']); } if (isset($this->paramsGrouped[$paramName]['systemName'])) { $responseProfile = ResponseProfilePeer::retrieveBySystemName($this->paramsGrouped[$paramName]['systemName']); } if ($responseProfile) { return new KalturaResponseProfile($responseProfile); } $typeReflector = KalturaTypeReflectorCacher::get('KalturaDetachedResponseProfile'); return $this->buildObject($typeReflector, $this->paramsGrouped[$paramName], $paramName); }
/** * Clone an existing response profile * * @action clone * @param int $id * @param KalturaResponseProfile $profile * @throws KalturaErrors::RESPONSE_PROFILE_ID_NOT_FOUND * @throws KalturaErrors::RESPONSE_PROFILE_DUPLICATE_SYSTEM_NAME * @return KalturaResponseProfile */ function cloneAction($id, KalturaResponseProfile $profile) { $origResponseProfileDbObject = ResponseProfilePeer::retrieveByPK($id); if (!$origResponseProfileDbObject) { throw new KalturaAPIException(KalturaErrors::RESPONSE_PROFILE_ID_NOT_FOUND, $id); } $newResponseProfileDbObject = $origResponseProfileDbObject->copy(); if ($profile) { $newResponseProfileDbObject = $profile->toInsertableObject($newResponseProfileDbObject); } $newResponseProfileDbObject->save(); $newResponseProfile = new KalturaResponseProfile(); $newResponseProfile->fromObject($newResponseProfileDbObject, $this->getResponseProfile()); return $newResponseProfile; }