public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null) { parent::doFromObject($dbObject, $responseProfile); /* @var $dbObject kEmailNotificationCategoryRecipientProvider */ $categoryIdFieldType = get_class($dbObject->getCategoryId()); KalturaLog::info("Retrieving API object for categoryId fild of type [{$categoryIdFieldType}]"); switch ($categoryIdFieldType) { case 'kObjectIdField': $this->categoryId = new KalturaObjectIdField(); break; case 'kEvalStringField': $this->categoryId = new KalturaEvalStringField(); break; case 'kStringValue': $this->categoryId = new KalturaStringValue(); break; default: $this->categoryId = KalturaPluginManager::loadObject('KalturaStringValue', $categoryIdFieldType); break; } if ($this->categoryId) { $this->categoryId->fromObject($dbObject->getCategoryId()); } if ($dbObject->getCategoryUserFilter()) { $this->categoryUserFilter = new KalturaCategoryUserProviderFilter(); $this->categoryUserFilter->fromObject($dbObject->getCategoryUserFilter()); } }
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null) { /* @var $dbObject kHttpNotificationDataText */ parent::doFromObject($dbObject, $responseProfile); if ($this->shouldGet('content', $responseProfile)) { $contentType = get_class($dbObject->getContent()); KalturaLog::debug("Loading KalturaStringValue from type [{$contentType}]"); switch ($contentType) { case 'kStringValue': $this->content = new KalturaStringValue(); break; case 'kEvalStringField': $this->content = new KalturaEvalStringField(); break; default: $this->content = KalturaPluginManager::loadObject('KalturaStringValue', $contentType); break; } if ($this->content) { $this->content->fromObject($dbObject->getContent()); } } if ($this->shouldGet('data', $responseProfile)) { $this->data = $dbObject->getData(); } }
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null) { /* @var $dbObject kEventValueCondition */ parent::doFromObject($dbObject, $responseProfile); $valueType = get_class($dbObject->getValue()); KalturaLog::debug("Loading KalturaStringValue from type [{$valueType}]"); switch ($valueType) { case 'kStringValue': $this->value = new KalturaStringValue(); break; case 'kEvalStringField': $this->value = new KalturaEvalStringField(); break; default: $this->value = KalturaPluginManager::loadObject('KalturaStringValue', $valueType); break; } if ($this->value) { $this->value->fromObject($dbObject->getValue()); } }
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null) { /* @var $dbObject kEmailNotificationRecipient */ parent::doFromObject($dbObject, $responseProfile); $emailType = get_class($dbObject->getEmail()); KalturaLog::debug("Loading KalturaStringValue from type [{$emailType}]"); switch ($emailType) { case 'kStringValue': $this->email = new KalturaStringValue(); break; case 'kEvalStringField': $this->email = new KalturaEvalStringField(); break; case 'kUserEmailContextField': $this->email = new KalturaUserEmailContextField(); break; default: $this->email = KalturaPluginManager::loadObject('KalturaStringValue', $emailType); break; } if ($this->email) { $this->email->fromObject($dbObject->getEmail()); } $nameType = get_class($dbObject->getName()); KalturaLog::debug("Loading KalturaStringValue from type [{$nameType}]"); switch ($nameType) { case 'kStringValue': $this->name = new KalturaStringValue(); break; case 'kEvalStringField': $this->name = new KalturaEvalStringField(); break; default: $this->name = KalturaPluginManager::loadObject('KalturaStringValue', $nameType); break; } if ($this->name) { $this->name->fromObject($dbObject->getName()); } }
/** * @param array<string|kBooleanValue> $strings * @return KalturaBooleanValueArray */ public static function fromDbArray(array $bools = null, KalturaDetachedResponseProfile $responseProfile = null) { $boolArray = new KalturaBooleanValueArray(); if ($bools && is_array($bools)) { foreach ($bools as $bool) { $boolObject = new KalturaStringValue(); if ($bool instanceof kValue) { $boolObject->fromObject($bool, $responseProfile); } else { $boolObject->value = $bool; } $boolArray[] = $boolObject; } } return $boolArray; }
/** * @param array<string|kStringValue> $strings * @return KalturaStringValueArray */ public static function fromDbArray(array $strings = null, KalturaDetachedResponseProfile $responseProfile = null) { $stringArray = new KalturaStringValueArray(); if ($strings && is_array($strings)) { foreach ($strings as $string) { $stringObject = new KalturaStringValue(); if ($string instanceof kValue) { $stringObject->fromObject($string, $responseProfile); } else { $stringObject->value = $string; } $stringArray[] = $stringObject; } } return $stringArray; }
/** * @param array<string|kIntegerValue> $strings * @return KalturaIntegerValueArray */ public static function fromDbArray(array $ints = null, KalturaDetachedResponseProfile $responseProfile = null) { $intArray = new KalturaIntegerValueArray(); if ($ints && is_array($ints)) { foreach ($ints as $int) { $intObject = new KalturaStringValue(); if ($int instanceof kValue) { $intObject->fromObject($int, $responseProfile); } else { $intObject->value = $int; } $intArray[] = $intObject; } } return $intArray; }