public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaDeliveryProfileArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = KalturaDeliveryProfileFactory::getDeliveryProfileInstanceByType($obj->getType());
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 /**
  * Add delivery based on existing delivery.
  * Must provide valid sourceDeliveryId
  *
  * @action clone
  * @param int $deliveryId
  * @return KalturaDeliveryProfile
  */
 function cloneAction($deliveryId)
 {
     $dbDelivery = DeliveryProfilePeer::retrieveByPK($deliveryId);
     if (!$dbDelivery) {
         throw new KalturaAPIException(APIErrors::DELIVERY_ID_NOT_FOUND, $deliveryId);
     }
     $className = get_class($dbDelivery);
     $class = new ReflectionClass($className);
     $dbKalturaDelivery = $class->newInstanceArgs(array());
     $dbKalturaDelivery = $dbDelivery->cloneToNew($dbKalturaDelivery);
     $delivery = KalturaDeliveryProfileFactory::getDeliveryProfileInstanceByType($dbKalturaDelivery->getType());
     $delivery->fromObject($dbKalturaDelivery, $this->getResponseProfile());
     return $delivery;
 }