本文整理汇总了PHP中BaseObject::getColumnsOldValue方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::getColumnsOldValue方法的具体用法?PHP BaseObject::getColumnsOldValue怎么用?PHP BaseObject::getColumnsOldValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::getColumnsOldValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: objectChanged
public function objectChanged(BaseObject $object, array $modifiedColumns)
{
$tagsIdsToRemove = array();
$oldTags = $object->getColumnsOldValue(self::getClassConstValue(get_class($object->getPeer()), self::TAGS_FIELD_NAME));
if ($oldTags && $oldTags != "") {
$tagsIdsToRemove = $this->checkExistForDelete($object, $oldTags);
}
$tagsToRemove = TagPeer::retrieveByPKs($tagsIdsToRemove);
foreach ($tagsToRemove as $tagToRemove) {
$tagToRemove->delete();
}
$tagsToAdd = $this->checkExistsForAdd($object);
$this->addTags($tagsToAdd, $this->getObjectIdByClassName(get_class($object)), $object->getPartnerId());
}
示例2: shouldConsumeChangedEvent
public function shouldConsumeChangedEvent(BaseObject $object, array $modifiedColumns)
{
if ($object instanceof entry && in_array(entryPeer::STATUS, $modifiedColumns) && ($object->getStatus() == entryStatus::READY || $object->getStatus() == entryStatus::ERROR_CONVERTING) && $object->getReplacedEntryId()) {
return true;
}
if ($object instanceof UploadToken && in_array(UploadTokenPeer::STATUS, $modifiedColumns) && $object->getStatus() == UploadToken::UPLOAD_TOKEN_FULL_UPLOAD) {
return true;
}
if ($object instanceof flavorAsset && in_array(assetPeer::STATUS, $modifiedColumns)) {
return true;
}
if ($object instanceof BatchJob && $object->getJobType() == BatchJobType::BULKUPLOAD && $object->getStatus() == BatchJob::BATCHJOB_STATUS_ABORTED && in_array(BatchJobPeer::STATUS, $modifiedColumns) && in_array($object->getColumnsOldValue(BatchJobPeer::STATUS), BatchJobPeer::getClosedStatusList())) {
return true;
}
if ($object instanceof UserRole && in_array(UserRolePeer::PERMISSION_NAMES, $modifiedColumns)) {
return true;
}
if ($object instanceof FileSync && in_array(FileSyncPeer::STATUS, $modifiedColumns) && $object->getStatus() == FileSync::FILE_SYNC_STATUS_DELETED) {
return true;
}
return false;
}
示例3: objectChanged
public function objectChanged(BaseObject $object, array $modifiedColumns)
{
$privacyContexts = null;
if ($object instanceof entry) {
$criteria = new Criteria();
$criteria->add(categoryEntryPeer::ENTRY_ID, $object->getId());
$categoryEntries = categoryEntryPeer::doSelect($criteria);
$privacyContexts = array(self::NULL_PC);
if (count($categoryEntries)) {
foreach ($categoryEntries as $categoryEntry) {
/* @var $categoryEntry categoryEntry */
if ($categoryEntry->getPrivacyContext() != "") {
$privacyContexts = array_merge($privacyContexts, self::trimObjectTags($categoryEntry->getPrivacyContext()));
} else {
$privacyContexts[] = kEntitlementUtils::DEFAULT_CONTEXT;
}
}
$privacyContexts = array_unique($privacyContexts);
}
}
$oldTags = $object->getColumnsOldValue(self::getClassConstValue(get_class($object->getPeer()), self::TAGS_FIELD_NAME));
$newTags = $object->getTags();
$tagsForDelete = implode(',', array_diff(explode(',', $oldTags), explode(',', $newTags)));
$tagsForUpdate = implode(',', array_diff(explode(',', $newTags), explode(',', $oldTags)));
if ($oldTags && $oldTags != "") {
self::decrementExistingTagsInstanceCount($tagsForDelete, $object->getPartnerId(), get_class($object), $privacyContexts);
}
self::addOrIncrementTags($tagsForUpdate, $object->getPartnerId(), get_class($object), $privacyContexts);
}