/** * Update an existing event notification template object * * @action update * @param int $id * @param KalturaEventNotificationTemplate $eventNotificationTemplate * @return KalturaEventNotificationTemplate * * @throws KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND */ public function updateAction($id, KalturaEventNotificationTemplate $eventNotificationTemplate) { // get the object $dbEventNotificationTemplate = EventNotificationTemplatePeer::retrieveByPK($id); if (!$dbEventNotificationTemplate) { throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND, $id); } // save the object $dbEventNotificationTemplate = $eventNotificationTemplate->toUpdatableObject($dbEventNotificationTemplate); $dbEventNotificationTemplate->save(); // return the saved object $eventNotificationTemplate = KalturaEventNotificationTemplate::getInstanceByType($dbEventNotificationTemplate->getType()); $eventNotificationTemplate->fromObject($dbEventNotificationTemplate, $this->getResponseProfile()); return $eventNotificationTemplate; }