/** * Set Conversion Profile to be the partner default * * @action setAsDefault * @param int $id * @return KalturaConversionProfile */ public function setAsDefaultAction($id) { $conversionProfileDb = conversionProfile2Peer::retrieveByPK($id); if (!$conversionProfileDb || $conversionProfileDb->getPartnerId() != $this->getPartnerId()) { throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $id); } $partner = $this->getPartner(); $partner->setDefaultConversionProfileId($id); $partner->save(); PartnerPeer::removePartnerFromCache($partner->getId()); $conversionProfile = new KalturaConversionProfile(); $conversionProfile->fromObject($conversionProfileDb); $conversionProfile->loadFlavorParamsIds($conversionProfileDb); return $conversionProfile; }
public function save(PropelPDO $con = null) { PartnerPeer::removePartnerFromCache($this->getId()); return parent::save($con); }
private static function markPartnerRoleCacheDirty($partnerId) { $partner = PartnerPeer::retrieveByPK($partnerId); if (!$partner) { KalturaLog::err("Cannot find partner with id [{$partnerId}]"); return; } $partner->setRoleCacheDirtyAt(time()); $partner->save(); PartnerPeer::removePartnerFromCache($partnerId); }
/** * @action updateConfiguration * @param int $partnerId * @param KalturaSystemPartnerConfiguration $configuration */ public function updateConfigurationAction($partnerId, KalturaSystemPartnerConfiguration $configuration) { $configuration->validatePropertyMinValue('adminLoginUsersQuota', 1, true); $dbPartner = PartnerPeer::retrieveByPK($partnerId); if (!$dbPartner) { throw new KalturaAPIException(KalturaErrors::UNKNOWN_PARTNER_ID, $partnerId); } $configuration->toUpdatableObject($dbPartner); $dbPartner->save(); PartnerPeer::removePartnerFromCache($partnerId); }
/** * Function to change a sub-publisher's status * @action updateStatus * @param int $id * @param KalturaPartnerStatus $status * @throws KalturaErrors::UNKNOWN_PARTNER_ID */ public function updateStatusAction($id, $status) { $c = PartnerPeer::getDefaultCriteria(); $c->addAnd(PartnerPeer::ID, $id); $dbPartner = PartnerPeer::doSelectOne($c); if (!$dbPartner) { throw new KalturaAPIException(KalturaErrors::UNKNOWN_PARTNER_ID, $id); } $dbPartner->setStatus($status); $dbPartner->save(); PartnerPeer::removePartnerFromCache($id); }
/** * @action updateConfiguration * @param int $partnerId * @param KalturaSystemPartnerConfiguration $configuration */ public function updateConfigurationAction($partnerId, KalturaSystemPartnerConfiguration $configuration) { $dbPartner = PartnerPeer::retrieveByPK($partnerId); if (!$dbPartner) { throw new KalturaAPIException(KalturaErrors::UNKNOWN_PARTNER_ID, $partnerId); } $configuration->toUpdatableObject($dbPartner); $dbPartner->save(); PartnerPeer::removePartnerFromCache($partnerId); }