本文整理汇总了PHP中BaseObject::getPartnerId方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::getPartnerId方法的具体用法?PHP BaseObject::getPartnerId怎么用?PHP BaseObject::getPartnerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::getPartnerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getScope
public function getScope()
{
$scope = parent::getScope();
if (method_exists($this->object, 'getPartnerId')) {
$scope->setPartnerId($this->object->getPartnerId());
}
return $scope;
}
示例2: getScope
public function getScope()
{
$scope = parent::getScope();
if ($this->raisedJob) {
$scope->setPartnerId($this->raisedJob->getPartnerId());
$scope->setParentRaisedJob($this->raisedJob);
} elseif (method_exists($this->object, 'getPartnerId')) {
$scope->setPartnerId($this->object->getPartnerId());
}
return $scope;
}
示例3: shouldConsumeDataChangedEvent
public function shouldConsumeDataChangedEvent(BaseObject $object, $previousVersion = null)
{
if (class_exists('CaptionAsset') && $object instanceof CaptionAsset) {
return CaptionSearchPlugin::isAllowedPartner($object->getPartnerId());
}
return false;
}
示例4: shouldConsumeCreatedEvent
public function shouldConsumeCreatedEvent(BaseObject $object)
{
if ($object instanceof flavorParamsOutputWrap && $object->getType() == WidevinePlugin::getAssetTypeCoreValue(WidevineAssetType::WIDEVINE_FLAVOR) && $this->shouldSyncWidevineRepositoryForPartner($object->getPartnerId())) {
return true;
} else {
return false;
}
}
示例5: objectDeleted
public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
{
$shortLinks = ShortLinkPeer::retrieveByKuserId($object->getId(), $object->getPartnerId());
foreach ($shortLinks as $shortLink) {
$shortLink->setStatus(ShortLinkStatus::DELETED);
$shortLink->save();
}
return true;
}
示例6: objectDeleted
/**
* @param BaseObject $object
* @param BatchJob $raisedJob
* @return bool true if should continue to the next consumer
*/
public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
{
if ($object instanceof asset && EdgeCastPlugin::isAllowedPartner($object->getPartnerId())) {
self::purgeAssetFromEdgeCast($object);
}
if ($object instanceof entry && EdgeCastPlugin::isAllowedPartner($object->getPartnerId())) {
self::purgeEntryFromEdgeCast($object);
}
return true;
}
示例7: contribute
/**
* @param BaseObject $object
* @param SimpleXMLElement $mrss
* @param kMrssParameters $mrssParams
* @return SimpleXMLElement
*/
public function contribute(BaseObject $object, SimpleXMLElement $mrss, kMrssParameters $mrssParams = null)
{
if (!$object instanceof entry) {
return;
}
$children = entryPeer::retrieveChildEntriesByEntryIdAndPartnerId($object->getId(), $object->getPartnerId());
if (!count($children)) {
return;
}
$childrenNode = $mrss->addChild('children');
$childrenDom = dom_import_simplexml($childrenNode);
foreach ($children as $child) {
$childXML = kMrssManager::getEntryMrssXml($child);
$childDom = dom_import_simplexml($childXML);
$childDom = $childrenDom->ownerDocument->importNode($childDom, true);
$childrenDom->appendChild($childDom);
}
}
示例8: copyMetadata
/**
* @param KalturaMetadataObjectType $objectType
* @param BaseObject $fromObject
* @param BaseObject $toObject
*/
protected function copyMetadata($objectType, BaseObject $fromObject, BaseObject $toObject)
{
KalturaLog::debug("Copy metadata type [{$objectType}] from " . get_class($fromObject) . '[' . $fromObject->getId() . "] to[" . $toObject->getId() . "]");
$c = new Criteria();
$c->add(MetadataPeer::OBJECT_TYPE, $objectType);
$c->add(MetadataPeer::OBJECT_ID, $fromObject->getId());
$metadatas = MetadataPeer::doSelect($c);
foreach ($metadatas as $metadata) {
$newMetadata = $metadata->copy();
$newMetadata->setObjectId($toObject->getId());
$newMetadata->setPartnerId($toObject->getPartnerId());
$metadataProfileId = kObjectCopyHandler::getMappedId('MetadataProfile', $metadata->getMetadataProfileId());
if ($metadataProfileId) {
$metadataProfile = MetadataProfilePeer::retrieveById($metadataProfileId);
if ($metadataProfile) {
$newMetadata->setMetadataProfileId($metadataProfileId);
$newMetadata->setMetadataProfileVersion($metadataProfile->getVersion());
}
}
$newMetadata->save();
kFileSyncUtils::createSyncFileLinkForKey($newMetadata->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA), $metadata->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA), false);
}
}
示例9: objectChanged
public function objectChanged(BaseObject $object, array $modifiedColumns)
{
// if changed object is entry
if ($object instanceof entry && in_array(entryPeer::MODERATION_STATUS, $modifiedColumns) && $object->getModerationStatus() == entry::ENTRY_MODERATION_STATUS_APPROVED) {
$externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($object->getPartnerId());
foreach ($externalStorages as $externalStorage) {
if ($externalStorage->getTrigger() == StorageProfile::STORAGE_TEMP_TRIGGER_MODERATION_APPROVED) {
self::exportEntry($object, $externalStorage);
}
}
}
// if changed object is flavor asset
if ($object instanceof flavorAsset && !$object->getIsOriginal() && in_array(assetPeer::STATUS, $modifiedColumns) && $object->isLocalReadyStatus()) {
$entry = $object->getentry();
$externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($object->getPartnerId());
foreach ($externalStorages as $externalStorage) {
if ($externalStorage->triggerFitsReadyAsset($entry->getId())) {
self::exportFlavorAsset($object, $externalStorage);
}
}
}
return true;
}
示例10: shouldConsumeChangedEvent
public function shouldConsumeChangedEvent(BaseObject $object, array $modifiedColumns)
{
if ($object instanceof Permission && $object->getPartnerId() && in_array($object->getType(), self::$partnerLevelPermissionTypes) && in_array(PermissionPeer::STATUS, $modifiedColumns) && $object->getStatus() == PermissionStatus::ACTIVE) {
return true;
}
return false;
}
示例11: setPartnerIdForObj
public static function setPartnerIdForObj(BaseObject $obj)
{
if (self::$s_set_partner_id_policy == self::PARTNER_SET_POLICY_NONE) {
return;
}
if ($obj == null) {
return;
}
$current_obj_partner = $obj->getPartnerId();
if (self::$s_set_partner_id_policy == self::PARTNER_SET_POLICY_IF_NULL && $current_obj_partner == null) {
$obj->setPartnerId(self::$s_current_partner_id);
return;
}
// force
$obj->setPartnerId(self::$s_current_partner_id);
}
示例12: setDisplayInSearch
/**
Will set the 'display_in_search' field according to business-logic per object type
// kuser | kshow | entry
// for objects that are search worthy - search_text will hold text from relevant columns depending on the object type
*/
public static function setDisplayInSearch(BaseObject $obj, $parent_obj = null)
{
if ($obj == null) {
return;
}
// update the displayInSearch with the logic above only when the object is new or null
if ($obj->isNew() || $obj->getDisplayInSearch() === null) {
$res = myPartnerUtils::shouldDisplayInSearch($obj->getPartnerId());
$obj_id = $obj->getId();
if ($obj_id && is_numeric($obj_id)) {
self::setRes($res, $obj_id > entry::MINIMUM_ID_TO_DISPLAY);
}
if ($res) {
if ($obj instanceof kuser) {
// if the status is not
self::setRes($res, $obj->getStatus() == KuserStatus::ACTIVE);
} elseif ($obj instanceof kshow) {
self::setRes($res, $obj->getViewPermissions() == kshow::KSHOW_PERMISSION_EVERYONE || $obj->getViewPermissions() == null);
// if the viewPermission changed from kshow::KSHOW_PERMISSION_EVERYONE to something else
// update all entries
if ($res && $obj->isColumnModified(kshowPeer::VIEW_PERMISSIONS)) {
$entries = $obj->getentrys();
foreach ($entries as $entry) {
// run this code for each entry
self::setDisplayInSearch($entry, $obj);
}
}
} elseif ($obj instanceof entry) {
// status=READY , type=MEDIACLIP, view permissions of kshow
self::setRes($res, true);
} else {
throw new Exception("mySearchUtils::setDisplayInSearch - cannot handle objects of type " . get_class($obj));
}
}
$obj->setDisplayInSearch($res);
} else {
// if not new - use the value from the object
$res = $obj->getDisplayInSearch();
}
// echo __METHOD__ . " (" . get_class ( $obj ) . ") res [$res]\n";
$words = "";
$fields_to_use = $obj->getColumnNames();
foreach ($fields_to_use as $field) {
$field_str = $obj->getByName($field, BasePeer::TYPE_FIELDNAME);
// call_user_func ( array ( $obj , $func_name ) );
$words .= " " . $field_str;
}
$extra_invisible_data = null;
if ($obj instanceof kshow) {
$type = $obj->getType();
if (empty($type)) {
$type = kshow::KSHOW_TYPE_OTHER;
}
// add the category to the search
$words .= " _CAT_" . $type;
} elseif ($obj instanceof entry) {
$extra_invisible_data = "_MEDIA_TYPE_" . $obj->getMediaType();
$type = $obj->getType();
// add the SEARCH_ENTRY_TYPE_RC to the words
if ($type == entryType::MIX) {
$extra_invisible_data .= " " . self::SEARCH_ENTRY_TYPE_RC;
}
}
$prepared_text = self::prepareSearchText($words);
$partner_id = $obj->getPartnerId();
// if res == 1 - only for partner , if == 2 - also for kaltura network
$obj->setSearchText(self::addPartner($partner_id, $prepared_text, $res, $extra_invisible_data));
}
示例13: shouldConsumeDeletedEvent
/**
* @param BaseObject $object
* @return bool true if the consumer should handle the event
*/
public function shouldConsumeDeletedEvent(BaseObject $object)
{
if ($object instanceof FileSync) {
if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_REMOTE_STORAGE, $object->getPartnerId())) {
return false;
}
if ($object->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
$storage = StorageProfilePeer::retrieveByPK($object->getDc());
if ($storage->getStatus() == StorageProfile::STORAGE_STATUS_AUTOMATIC && $storage->getAllowAutoDelete()) {
return true;
}
}
}
return false;
}
示例14: getSearchData
/**
* Return textual search data to be associated with the object
*
* @param BaseObject $object
* @return string
*/
public static function getSearchData(BaseObject $object)
{
if ($object instanceof entry) {
if (self::isAllowedPartner($object->getPartnerId())) {
return kMetadataManager::getSearchValuesByObject(Metadata::TYPE_ENTRY, $object->getId());
}
}
return null;
}
示例15: objectCreated
public function objectCreated(BaseObject $object)
{
if ($object instanceof Permission) {
// changes in permissions for partner, may require new cache generation
if ($object->getPartnerId() != PartnerPeer::GLOBAL_PARTNER) {
self::markPartnerRoleCacheDirty($object->getPartnerId());
return true;
}
}
if ($object instanceof PermissionToPermissionItem) {
$permission = $object->getPermission();
if ($permission && $permission->getPartnerId() != PartnerPeer::GLOBAL_PARTNER) {
self::markPartnerRoleCacheDirty($permission->getPartnerId());
return true;
}
}
return true;
}