Example #1
0
 /**
  * Retrieve extra information about media found in search action
  * 	 Some providers return only part of the fields needed to create entry from, use this action to get the rest of the fields.
  * 	 
  * 
  * @return \Kaltura\Client\Type\SearchResult
  */
 function getMediaInfo(\Kaltura\Client\Type\SearchResult $searchResult)
 {
     $kparams = array();
     $this->client->addParam($kparams, "searchResult", $searchResult->toParams());
     $this->client->queueServiceActionCall("search", "getMediaInfo", "KalturaSearchResult", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultXml = $this->client->doQueue();
     $resultXmlObject = new \SimpleXMLElement($resultXml);
     \Kaltura\Client\ParseUtils::checkIfError($resultXmlObject->result);
     $resultObject = \Kaltura\Client\ParseUtils::unmarshalObject($resultXmlObject->result, "KalturaSearchResult");
     $this->client->validateObjectType($resultObject, "\\Kaltura\\Client\\Type\\SearchResult");
     return $resultObject;
 }
Example #2
0
 /**
  * Adds new media entry by importing the media file from a search provider.
  * 	 This action should be used with the search service result.
  * 	 
  * 
  * @return \Kaltura\Client\Type\MediaEntry
  */
 function addFromSearchResult(\Kaltura\Client\Type\MediaEntry $mediaEntry = null, \Kaltura\Client\Type\SearchResult $searchResult = null)
 {
     $kparams = array();
     if ($mediaEntry !== null) {
         $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams());
     }
     if ($searchResult !== null) {
         $this->client->addParam($kparams, "searchResult", $searchResult->toParams());
     }
     $this->client->queueServiceActionCall("media", "addFromSearchResult", "KalturaMediaEntry", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultXml = $this->client->doQueue();
     $resultXmlObject = new \SimpleXMLElement($resultXml);
     \Kaltura\Client\ParseUtils::checkIfError($resultXmlObject->result);
     $resultObject = \Kaltura\Client\ParseUtils::unmarshalObject($resultXmlObject->result, "KalturaMediaEntry");
     $this->client->validateObjectType($resultObject, "\\Kaltura\\Client\\Type\\MediaEntry");
     return $resultObject;
 }