public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     $cPlatformXml = $this->getValue('cplatform_xml');
     $doc = new DOMDocument();
     $doc->loadXML($cPlatformXml);
     $itemsNode = $doc->getElementsByTagName('items')->item(0);
     $cPlatformArray = array();
     if ($itemsNode) {
         $itemNodes = $itemsNode->getElementsByTagName('item');
         foreach ($itemNodes as $itemNode) {
             $keyNode = $itemNode->getElementsByTagName('key')->item(0);
             $valueNode = $itemNode->getElementsByTagName('value')->item(0);
             $keyVal = new Kaltura_Client_Type_KeyValue();
             $keyVal->key = $keyNode->nodeValue;
             $filter = new Zend_Filter_Alnum(true);
             $keyVal->value = $filter->filter($valueNode->nodeValue);
             $cPlatformArray[] = $keyVal;
         }
     }
     $object->cPlatformTvSeries = $cPlatformArray;
     $object->cPlatformTvSeriesField = $this->getValue('c_platform_tv_series_field');
     // because parent::getObject doesn't include empty fields
     $object->feedLink = $this->getValue('feed_link');
     // because parent::getObject doesn't include empty fields
     return $object;
 }
예제 #2
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     /* @var $object Kaltura_Client_FtpDistribution_Type_FtpDistributionProfile */
     $object = parent::getObject($objectType, $properties, $add_underscore, true);
     $upload = new Zend_File_Transfer_Adapter_Http();
     $files = $upload->getFileInfo();
     if (isset($files['sftp_public_key'])) {
         $object->sftpPublicKey = $this->getFileContent($files['sftp_public_key']);
     }
     if (isset($files['sftp_private_key'])) {
         $object->sftpPrivateKey = $this->getFileContent($files['sftp_private_key']);
     }
     if (isset($files['aspera_public_key'])) {
         $object->asperaPublicKey = $this->getFileContent($files['aspera_public_key']);
     }
     if (isset($files['aspera_private_key'])) {
         $object->asperaPrivateKey = $this->getFileContent($files['aspera_private_key']);
     }
     $updateRequiredEntryFields = array();
     $updateRequiredMetadataXpaths = array();
     $entryFields = array_keys($this->getEntryFields());
     $metadataXpaths = array_keys($this->getMetadataFields());
     $fieldConfigArray = $object->fieldConfigArray;
     foreach ($properties as $property => $value) {
         if (!$value) {
             continue;
         }
         $updateField = null;
         $matches = null;
         if (preg_match('/update_required_entry_fields_(\\d+)$/', $property, $matches)) {
             $index = $matches[1];
             if (isset($entryFields[$index])) {
                 $updateField = $entryFields[$index];
             }
         }
         if (preg_match('/update_required_metadata_xpaths_(\\d+)$/', $property, $matches)) {
             $index = $matches[1];
             if (isset($metadataXpaths[$index])) {
                 $updateField = $metadataXpaths[$index];
             }
         }
         if ($updateField) {
             $fieldConfig = new Kaltura_Client_ContentDistribution_Type_DistributionFieldConfig();
             $fieldConfig->fieldName = md5($updateField);
             // needs to have a value for the field to get saved
             $fieldConfig->updateOnChange = true;
             $string = new Kaltura_Client_Type_String();
             $string->value = $updateField;
             $fieldConfig->updateParams = array($string);
             $fieldConfigArray[] = $fieldConfig;
         }
     }
     $object->fieldConfigArray = $fieldConfigArray;
     return $object;
 }
예제 #3
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     if ($object instanceof Kaltura_Client_TvinciDistribution_Type_TvinciDistributionProfile) {
         $upload = new Zend_File_Transfer_Adapter_Http();
         $files = $upload->getFileInfo();
         if (isset($files['xsltFile'])) {
             $file = $files['xsltFile'];
             $content = file_get_contents($file['tmp_name']);
             $object->xsltFile = $content;
         }
     }
     return $object;
 }
예제 #4
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     $upload = new Zend_File_Transfer_Adapter_Http();
     $files = $upload->getFileInfo();
     if (isset($files['aspera_public_key'])) {
         $object->asperaPublicKey = $this->getFileContent($files['aspera_public_key']);
     }
     if (isset($files['aspera_private_key'])) {
         $object->asperaPrivateKey = $this->getFileContent($files['aspera_private_key']);
     }
     $additionalCategories = isset($properties['series_additional_categories']) && is_array($properties['itemXpathsToExtend']) ? $properties['series_additional_categories'] : array();
     foreach ($additionalCategories as &$val) {
         $temp = new Kaltura_Client_Type_String();
         $temp->value = $val;
         $val = $temp;
     }
     $object->seriesAdditionalCategories = $additionalCategories;
     return $object;
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     if ($object instanceof Kaltura_Client_YouTubeDistribution_Type_YouTubeDistributionProfile) {
         $upload = new Zend_File_Transfer_Adapter_Http();
         $files = $upload->getFileInfo();
         if (isset($files['sftp_public_key'])) {
             $file = $files['sftp_public_key'];
             if ($file['size']) {
                 $content = file_get_contents($file['tmp_name']);
                 $object->sftpPublicKey = $content;
             }
         }
         if (isset($files['sftp_private_key'])) {
             $file = $files['sftp_private_key'];
             if ($file['size']) {
                 $content = file_get_contents($file['tmp_name']);
                 $object->sftpPrivateKey = $content;
             }
         }
     }
     return $object;
 }
예제 #6
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, true);
     /* @var $object Kaltura_Client_MsnDistribution_Type_MsnDistributionProfile */
     $requiredFlavorParamsIds = array();
     if ($object->sourceFlavorParamsId != -1) {
         $requiredFlavorParamsIds[] = $object->sourceFlavorParamsId;
     }
     if ($object->flvFlavorParamsId != -1) {
         $requiredFlavorParamsIds[] = $object->flvFlavorParamsId;
     }
     if ($object->wmvFlavorParamsId != -1) {
         $requiredFlavorParamsIds[] = $object->wmvFlavorParamsId;
     }
     if ($object->slFlavorParamsId != -1) {
         $requiredFlavorParamsIds[] = $object->slFlavorParamsId;
     }
     if ($object->slHdFlavorParamsId != -1) {
         $requiredFlavorParamsIds[] = $object->slHdFlavorParamsId;
     }
     $object->requiredFlavorParamsIds = implode(',', $requiredFlavorParamsIds);
     return $object;
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = true)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     return $object;
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = true)
 {
     // $include_empty_fields is defaulted to true instead of false, so we can empty fields
     return parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     /* @var $object Kaltura_Client_CrossKalturaDistribution_Type_CrossKalturaDistributionProfile */
     $object = parent::getObject($objectType, $properties, $add_underscore, true);
     // transform the regular metadataXpathsTriggerUpdate array to a KalturaStringValueArray
     $xpathsKalturaArray = array();
     $uniqXpaths = is_array($object->metadataXpathsTriggerUpdate) ? array_unique($object->metadataXpathsTriggerUpdate) : array();
     foreach ($uniqXpaths as $xpath) {
         $xpathStringValue = new Kaltura_Client_Type_StringValue();
         $xpathStringValue->value = $xpath;
         $xpathsKalturaArray[] = $xpathStringValue;
     }
     $object->metadataXpathsTriggerUpdate = $xpathsKalturaArray;
     // transform source/target map fields
     $object->mapAccessControlProfileIds = isset($properties[self::ELEMENT_MAP_ACCESS_CONTROL_IDS]) ? json_decode($properties[self::ELEMENT_MAP_ACCESS_CONTROL_IDS], true) : array();
     $object->mapConversionProfileIds = isset($properties[self::ELEMENT_MAP_CONVERSION_PROFILE_IDS]) ? json_decode($properties[self::ELEMENT_MAP_CONVERSION_PROFILE_IDS], true) : array();
     $object->mapMetadataProfileIds = isset($properties[self::ELEMENT_MAP_METADATA_PROFILE_IDS]) ? json_decode($properties[self::ELEMENT_MAP_METADATA_PROFILE_IDS], true) : array();
     $object->mapStorageProfileIds = isset($properties[self::ELEMENT_MAP_STORAGE_PROFILE_IDS]) ? json_decode($properties[self::ELEMENT_MAP_STORAGE_PROFILE_IDS], true) : array();
     $object->mapFlavorParamsIds = isset($properties[self::ELEMENT_MAP_FLAVOR_PARAMS_IDS]) ? json_decode($properties[self::ELEMENT_MAP_FLAVOR_PARAMS_IDS], true) : array();
     $object->mapThumbParamsIds = isset($properties[self::ELEMENT_MAP_THUMB_PARAMS_IDS]) ? json_decode($properties[self::ELEMENT_MAP_THUMB_PARAMS_IDS], true) : array();
     $object->mapCaptionParamsIds = isset($properties[self::ELEMENT_MAP_CAPTION_PARAMS_IDS]) ? json_decode($properties[self::ELEMENT_MAP_CAPTION_PARAMS_IDS], true) : array();
     return $object;
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     $object->cuePointsProvider = $this->getValue('cue_points_provider');
     return $object;
 }