예제 #1
0
 public static function fromDbArray(array $arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaWidgetArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaWidget();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
예제 #2
0
 /**
  * Add widget based on existing widget.
  * Must provide valid sourceWidgetId
  * 
  * @action clone
  * @paran KalturaWidget $widget
  * @return KalturaWidget
  */
 function cloneAction(KalturaWidget $widget)
 {
     $dbWidget = widgetPeer::retrieveByPK($widget->sourceWidgetId);
     if (!$dbWidget) {
         throw new KalturaAPIException(APIErrors::INVALID_WIDGET_ID, $widget->sourceWidgetId);
     }
     $newWidget = widget::createWidgetFromWidget($dbWidget, $widget->kshowId, $widget->entryId, $widget->uiConfId, null, $widget->partnerData, $widget->securityType);
     if (!$newWidget) {
         throw new KalturaAPIException(APIErrors::INVALID_KSHOW_AND_ENTRY_PAIR, $widget->kshowId, $widget->entryId);
     }
     $widget = new KalturaWidget();
     $widget->fromObject($newWidget, $this->getResponseProfile());
     return $widget;
 }