public function toObject($object = null, $skip = array()) { if (is_null($object)) { $object = new PodcastDistributionProfile(); } return parent::toObject($object, $skip); }
public function toObject($object = null, $skip = array()) { if (is_null($object)) { $object = new SyndicationDistributionProfile(); } if (count(explode(",", $this->requiredFlavorParamsIds)) > 1) { throw new KalturaAPIException(KalturaErrors::INVALID_FIELD_VALUE, "requiredFlavorParamsIds"); } return parent::toObject($object, $skip); }
public function toObject($dbObject = null, $skip = array()) { /* @var $dbObject ConfigurableDistributionProfile */ parent::toObject($dbObject, $skip); if ($this->useCategoryEntries) { $features = $dbObject->getExtendedFeatures(); $features[] = ObjectFeatureType::CATEGORY_ENTRIES; $dbObject->setExtendedFeatures(array_unique($features)); } return $dbObject; }
public function toObject($object = null, $skip = array()) { if (is_null($object)) { $object = new GenericDistributionProfile(); } $object = parent::toObject($object, $skip); foreach (self::$actions as $action) { $actionAttribute = "{$action}Action"; if (!$this->{$actionAttribute}) { continue; } $typeReflector = KalturaTypeReflectorCacher::get(get_class($this->{$actionAttribute})); foreach ($this->{$actionAttribute}->getMapBetweenObjects() as $this_prop => $object_prop) { if (is_numeric($this_prop)) { $this_prop = $object_prop; } if (in_array($this_prop, $skip)) { continue; } $value = $this->{$actionAttribute}->{$this_prop}; if ($value !== null) { $propertyInfo = $typeReflector->getProperty($this_prop); if (!$propertyInfo) { KalturaLog::alert("property [{$this_prop}] was not found on object class [" . get_class($object) . "]"); } else { if ($propertyInfo->isDynamicEnum()) { $propertyType = $propertyInfo->getType(); $enumType = call_user_func(array($propertyType, 'getEnumClass')); $value = kPluginableEnumsManager::apiToCore($enumType, $value); } } if ($value !== null) { $setter_callback = array($object, "set{$object_prop}"); if (is_callable($setter_callback)) { call_user_func_array($setter_callback, array($value, $action)); } else { KalturaLog::alert("setter for property [{$object_prop}] was not found on object class [" . get_class($object) . "]"); } } } } } $object->setUpdateRequiredEntryFields(explode(',', $this->updateRequiredEntryFields)); $object->setUpdateRequiredMetadataXpaths(explode(',', $this->updateRequiredMetadataXPaths)); return $object; }
public function toObject($dbObject = null, $skip = array()) { if (is_null($dbObject)) { return null; } parent::toObject($dbObject, $skip); if (!is_null($this->fieldConfigArray)) { $dbFieldConfigArray = array(); foreach ($this->fieldConfigArray as $fieldConfig) { $dbFieldConfigArray[] = $fieldConfig->toObject(); } $dbObject->setFieldConfigArray($dbFieldConfigArray); } if (!is_null($this->itemXpathsToExtend)) { $itemXpathsToExtendArray = array(); foreach ($this->itemXpathsToExtend as $stringObj) { $itemXpathsToExtendArray[] = $stringObj->value; } $dbObject->setItemXpathsToExtend($itemXpathsToExtendArray); } return $dbObject; }