/** * Update an existing UIConf * * @action update * @param int $id * @param KalturaUiConf $uiConf * @return KalturaUiConf * * @throws APIErrors::INVALID_UI_CONF_ID */ function updateAction($id, KalturaUiConf $uiConf) { $dbUiConf = uiConfPeer::retrieveByPK($id); if (!$dbUiConf) { throw new KalturaAPIException(APIErrors::INVALID_UI_CONF_ID, $id); } $uiConfUpdate = $uiConf->toUiConf(); $allowEmpty = true; // TODO - what is the policy ? baseObjectUtils::autoFillObjectFromObject($uiConfUpdate, $dbUiConf, $allowEmpty); $dbUiConf->save(); $uiConf->fromUiConf($dbUiConf); return $uiConf; }
/** * UIConf Add action allows you to add a UIConf to Kaltura DB * * @action add * @param KalturaUiConf $uiConf Mandatory input parameter of type KalturaUiConf * @return KalturaUiConf */ function addAction(KalturaUiConf $uiConf) { $uiConf->validatePropertyNotNull('creationMode'); if ($uiConf->creationMode != KalturaUiConfCreationMode::ADVANCED && $uiConf->creationMode != KalturaUiConfCreationMode::WIZARD) { throw new KalturaAPIException("Should not create MANUAL ui_confs via the API!! MANUAL is deprecated"); } // if not specified set to true (default) if (is_null($uiConf->useCdn)) { $uiConf->useCdn = true; } $dbUiConf = $uiConf->toUiConf(); $dbUiConf->setPartnerId($this->getPartnerId()); $dbUiConf->save(); $uiConf = new KalturaUiConf(); // start from blank $uiConf->fromObject($dbUiConf, $this->getResponseProfile()); return $uiConf; }