/** * Add new response profile * * @action add * @param KalturaResponseProfile $addResponseProfile * @return KalturaResponseProfile */ function addAction(KalturaResponseProfile $addResponseProfile) { $dbResponseProfile = $addResponseProfile->toInsertableObject(); /* @var $dbResponseProfile ResponseProfile */ $dbResponseProfile->setPartnerId($this->getPartnerId()); $dbResponseProfile->setStatus(ResponseProfileStatus::ENABLED); $dbResponseProfile->save(); $addResponseProfile = new KalturaResponseProfile(); $addResponseProfile->fromObject($dbResponseProfile, $this->getResponseProfile()); return $addResponseProfile; }
/** * 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; }