public function toObject($dbData = null, $props_to_skip = array()) { if (is_null($dbData)) { $dbData = new kCopyJobData(); } $dbData->setTemplateObject($this->templateObject->toInsertableObject()); return parent::toObject($dbData, $props_to_skip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { $object_to_fill = parent::toInsertableObject($object_to_fill, $props_to_skip); if (empty($this->userId)) { $currentKsKuser = kCurrentContext::getCurrentKsKuserId(); $object_to_fill->setKuserId($currentKsKuser); } else { $kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userId); if (!$kuser) { throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $this->userId); } $object_to_fill->setKuserId($kuser->getKuserId()); } $object_to_fill->setPartnerId(kCurrentContext::getCurrentPartnerId()); return $object_to_fill; }
/** * @param Annotation $dbAnnotation * @param array $propsToSkip * @return Annotation */ public function toInsertableObject($dbAnnotation = null, $propsToSkip = array()) { if (is_null($dbAnnotation)) { $dbAnnotation = new Annotation(); } return parent::toInsertableObject($dbAnnotation, $propsToSkip); }
/** * @param AuditTrail $dbAuditTrail * @param array $propsToSkip * @return AuditTrail */ public function toInsertableObject($dbAuditTrail = null, $propsToSkip = array()) { if (is_null($dbAuditTrail)) { $dbAuditTrail = new AuditTrail(); } return parent::toInsertableObject($dbAuditTrail, $propsToSkip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { KalturaLog::alert("No object returned from toInsertableObject, object_to_fill [" . get_class($object_to_fill) . "], this [" . get_class($this) . "] line [" . __LINE__ . "]"); return null; } $dbObject = parent::toInsertableObject($object_to_fill, $props_to_skip); if (!$dbObject) { KalturaLog::alert("No object returned from toInsertableObject, object_to_fill [" . get_class($object_to_fill) . "], this [" . get_class($this) . "] line [" . __LINE__ . "]"); return null; } $pluginsData = $this->createPluginDataMap(); $dbObject->setPluginsData($pluginsData); return $dbObject; }
public function toInsertableObject($dbAppToken = null, $skip = array()) { $partnerId = kCurrentContext::getCurrentPartnerId(); $partner = PartnerPeer::retrieveByPK($partnerId); if ($this->isNull('sessionDuration')) { $this->sessionDuration = $partner->getKsMaxExpiryInSeconds(); } $dbAppToken = parent::toInsertableObject($dbAppToken, $skip); /* @var $dbAppToken AppToken */ $dbAppToken->setPartnerId($partnerId); $dbAppToken->setToken(bin2hex(openssl_random_pseudo_bytes(16))); $dbAppToken->setStatus(AppTokenStatus::ACTIVE); return $dbAppToken; }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { $hasPrivacyContext = false; if ($this->privacyContext) { $hasPrivacyContext = true; } elseif ($this->parentId != null) { $parentCategory = categoryPeer::retrieveByPK($this->parentId); if (!$parentCategory) { throw new KalturaAPIException(KalturaErrors::CATEGORY_NOT_FOUND, $this->parentId); } if ($parentCategory->getPrivacyContexts()) { $hasPrivacyContext = true; } } if ($hasPrivacyContext) { if (!$this->owner && $this->inheritanceType != KalturaInheritanceType::INHERIT) { if (kCurrentContext::getCurrentKsKuser()) { $this->owner = kCurrentContext::getCurrentKsKuser()->getPuserId(); } } } return parent::toInsertableObject($object_to_fill, $props_to_skip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new StorageProfile(); } return parent::toInsertableObject($object_to_fill, $props_to_skip); }
public function toInsertableObject($dbObject = null, $skip = array()) { if (is_null($this->permissionLevel)) { $category = categoryPeer::retrieveByPK($this->categoryId); if (!$category) { throw new KalturaAPIException(KalturaErrors::CATEGORY_NOT_FOUND, $this->categoryId); } $this->permissionLevel = $category->getDefaultPermissionLevel(); } return parent::toInsertableObject($dbObject, $skip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { return parent::toInsertableObject(new mediaInfo(), $props_to_skip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new EdgeServer(); } return parent::toInsertableObject($object_to_fill, $props_to_skip); }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { $dbObject = parent::toInsertableObject(new BulkUploadResult(), $props_to_skip); $pluginsData = array(); if ($this->pluginsData && $this->pluginsData instanceof KalturaBulkUploadPluginDataArray) { foreach ($this->pluginsData as $data) { // KalturaLog::debug("Plugins data item is " . get_class($data)); if ($data instanceof KalturaBulkUploadPluginData) { $pluginsData[$data->field] = $data->value; } } } KalturaLog::debug("Plugins data array:\n" . print_r($pluginsData, true)); $dbObject->setPluginsData($pluginsData); return $dbObject; }
public function toInsertableObject($objectToFill = null, $propertiesToSkip = array()) { if (is_null($this->status)) { $this->status = KalturaScheduledTaskProfileStatus::DISABLED; } return parent::toInsertableObject($objectToFill, $propertiesToSkip); }