public function toObject($dbObject = null, $skip = array()) { if (!is_null($this->value) && !$this->value instanceof KalturaNullField) { throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_NOT_UPDATABLE, $this->getFormattedPropertyNameWithClassName('value')); } return parent::toObject($dbObject, $skip); }
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null) { /* @var $dbObject kFieldMatchCondition */ parent::doFromObject($dbObject, $responseProfile); $valueType = get_class($dbObject->getValue()); KalturaLog::debug("Loading KalturaIntegerValue from type [{$valueType}]"); switch ($valueType) { case 'kIntegerValue': $this->value = new KalturaIntegerValue(); break; case 'kTimeContextField': $this->value = new KalturaTimeContextField(); break; default: $this->value = KalturaPluginManager::loadObject('KalturaIntegerValue', $valueType); break; } if ($this->value) { $this->value->fromObject($dbObject->getValue()); } }