protected function doFromObject($srcObj, KalturaDetachedResponseProfile $responseProfile = null) { parent::doFromObject($srcObj); $features = $srcObj->getExtendedFeatures(); if (in_array(ObjectFeatureType::CATEGORY_ENTRIES, $features)) { $this->useCategoryEntries = true; } }
public function doFromObject($object, KalturaDetachedResponseProfile $responseProfile = null) { parent::doFromObject($object, $responseProfile); foreach (self::$actions as $action) { if (!$this->shouldGet('$actionAttribute', $responseProfile)) { continue; } $actionAttribute = "{$action}Action"; if (!$this->{$actionAttribute}) { $this->{$actionAttribute} = new KalturaGenericDistributionProfileAction(); } $reflector = KalturaTypeReflectorCacher::get(get_class($this->{$actionAttribute})); $properties = $reflector->getProperties(); foreach ($this->{$actionAttribute}->getMapBetweenObjects() as $this_prop => $object_prop) { if (is_numeric($this_prop)) { $this_prop = $object_prop; } if (!isset($properties[$this_prop]) || $properties[$this_prop]->isWriteOnly()) { continue; } $getter_callback = array($object, "get{$object_prop}"); if (is_callable($getter_callback)) { $value = call_user_func($getter_callback, $action); if ($properties[$this_prop]->isDynamicEnum()) { $propertyType = $properties[$this_prop]->getType(); $enumType = call_user_func(array($propertyType, 'getEnumClass')); $value = kPluginableEnumsManager::coreToApi($enumType, $value); } $this->{$actionAttribute}->{$this_prop} = $value; } else { KalturaLog::alert("getter for property [{$object_prop}] was not found on object class [" . get_class($object) . "]"); } } } if ($this->shouldGet('updateRequiredEntryFields', $responseProfile)) { $this->updateRequiredEntryFields = implode(',', $object->getUpdateRequiredEntryFields()); } if ($this->shouldGet('updateRequiredMetadataXPaths', $responseProfile)) { $this->updateRequiredMetadataXPaths = implode(',', $object->getUpdateRequiredMetadataXPaths()); } }