Esempio n. 1
0
 /**
  * batch getBulkUploadLastResultAction action returns the last result of the bulk upload
  *
  * @action getBulkUploadLastResult
  * @param int $bulkUploadJobId The id of the bulk upload job
  * @return KalturaBulkUploadResult
  */
 function getBulkUploadLastResultAction($bulkUploadJobId)
 {
     $dbBulkUploadResult = BulkUploadResultPeer::retrieveLastByBulkUploadId($bulkUploadJobId);
     if (!$dbBulkUploadResult) {
         return null;
     }
     $bulkUploadResult = new KalturaBulkUploadResult();
     $bulkUploadResult->fromObject($dbBulkUploadResult, $this->getResponseProfile());
     return $bulkUploadResult;
 }
 public static function fromBulkUploadResultArray($arr)
 {
     $newArr = new KalturaBulkUploadResultArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaBulkUploadResult();
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaBulkUploadResultArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaBulkUploadResult();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     //No need to add objectId to result with status ERROR
     if ($this->status != KalturaBulkUploadResultStatus::ERROR) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($this->partnerId, $this->userId);
         if (!$kuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $categoryKuser = categoryKuserPeer::retrieveByCategoryIdAndKuserId($this->categoryId, $kuser->getId());
         if ($categoryKuser) {
             $this->objectId = $categoryKuser->getId();
         }
     }
     return parent::toObject($object_to_fill, $props_to_skip);
 }
 function addBulkUploadResult(KalturaBulkUploadResult $bulkUploadResult, array $pluginDataArray = null)
 {
     $kparams = array();
     $this->client->addParam($kparams, "bulkUploadResult", $bulkUploadResult->toParams());
     if ($pluginDataArray !== null) {
         foreach ($pluginDataArray as $index => $obj) {
             $this->client->addParam($kparams, "pluginDataArray:{$index}", $obj->toParams());
         }
     }
     $this->client->queueServiceActionCall("metadata_metadatabatch", "addBulkUploadResult", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaBulkUploadResult");
     return $resultObject;
 }
 public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     if (!is_numeric($this->objectId)) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($this->partnerId, $this->userId);
         if ($kuser) {
             $this->objectId = $kuser->getId();
         }
     }
     return parent::toObject($object_to_fill, $props_to_skip);
 }
 public function toInsertableObject($object_to_fill = null, $props_to_skip = array())
 {
     return parent::toInsertableObject(new BulkUploadResultCategory(), $props_to_skip);
 }
 public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     if ($this->entryId) {
         $this->objectId = $this->entryId;
     }
     if ($this->entryStatus) {
         $this->objectStatus = $this->entryStatus;
     }
     return parent::toObject($object_to_fill, $props_to_skip);
 }