本文整理汇总了PHP中modObjectUpdateProcessor::afterSave方法的典型用法代码示例。如果您正苦于以下问题:PHP modObjectUpdateProcessor::afterSave方法的具体用法?PHP modObjectUpdateProcessor::afterSave怎么用?PHP modObjectUpdateProcessor::afterSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modObjectUpdateProcessor
的用法示例。
在下文中一共展示了modObjectUpdateProcessor::afterSave方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterSave
/** {@inheritDoc} */
public function afterSave()
{
/*
$this->thread->fromArray(array(
'comment_last' => $this->object->get('id'),
'comment_time' => $this->object->get('createdon'),
));
$this->thread->save();
*/
$this->thread->updateLastMessage();
/* @var ecMessage $m */
if ($m = $this->modx->getObject('ecMessage', $this->getProperty('id'))) {
if ($m->notifyUser()) {
$m->set('notify', 0);
$m->set('notify_date', date('Y-m-d H:i:s'));
$m->save();
}
}
return parent::afterSave();
}
示例2: afterSave
public function afterSave()
{
/** @var xPDOFileCache $provider */
$provider = $this->modx->cacheManager->getCacheProvider('oauth2server');
$provider->flush();
return parent::afterSave();
}
示例3: afterSave
public function afterSave()
{
if ($this->modx->hasPermission('usergroup_user_edit')) {
$this->addUsers();
}
return parent::afterSave();
}
示例4: afterSave
public function afterSave()
{
$this->updateTranslations($this->getProperties());
$this->refreshURIs();
$this->clearCache();
return parent::afterSave();
}
示例5: afterSave
public function afterSave()
{
/* now store the permissions into the modAccessPermission table */
/* and cache the data into the policy table */
$permissions = $this->getProperty('permissions', null);
if ($permissions !== null) {
$permissions = is_array($permissions) ? $permissions : $this->modx->fromJSON($permissions);
/* first erase all prior permissions */
$oldPermissions = $this->object->getMany('Permissions');
/** @var modAccessPermission $permission */
foreach ($oldPermissions as $permission) {
$permission->remove();
}
$added = array();
foreach ($permissions as $permissionArray) {
if (in_array($permissionArray['name'], $added)) {
continue;
}
$permission = $this->modx->newObject('modAccessPermission');
$permission->set('template', $this->object->get('id'));
$permission->set('name', $permissionArray['name']);
$permission->set('description', $permissionArray['description']);
$permission->set('value', true);
$permission->save();
$added[] = $permissionArray['name'];
}
}
return parent::afterSave();
}
示例6: afterSave
/**
* {@inheritDoc}
*
* @return mixed
*/
public function afterSave()
{
if ($this->refreshURIs) {
$this->modx->call('modResource', 'refreshURIs', array(&$this->modx));
}
return parent::afterSave();
}
示例7: afterSave
public function afterSave()
{
$this->saveRequired();
if ($this->validationType) {
$this->saveValidation();
}
return parent::afterSave();
}
示例8: afterSave
public function afterSave()
{
$this->clearOldRules();
$this->setFieldRules();
$this->setTabRules();
$this->setTVRules();
$this->saveNewRules();
return parent::afterSave();
}
示例9: afterSave
/**
* After save
* Add comment to cache
*
* @return void
*/
public function afterSave()
{
if ($this->modx->modxtalks->mtCache === true) {
if (!$this->modx->modxtalks->cacheComment($this->object)) {
$this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/vote] Cache comment error, ID ' . $this->object->id);
}
}
return parent::afterSave();
}
示例10: afterSave
/** {@inheritDoc} */
public function afterSave()
{
if ($event = $this->modx->getObject('vpEvent', $this->object->get('event'))) {
$eventName = $event->get('name');
/* set event */
$this->modx->virtualpage->doEvent('create', $eventName, 'vpEvent', 10);
}
return parent::afterSave();
}
示例11: afterSave
public function afterSave()
{
/* now store the permissions into the modAccessPermission table */
/* and cache the data into the policy table */
$permissions = $this->getProperty('permissions', null);
if ($permissions !== null) {
$new_permissions_list = array();
if (!is_array($permissions)) {
$permissions = $this->modx->fromJSON($permissions);
foreach ($permissions as $permission_item) {
$new_permissions_list[] = $permission_item['name'];
}
} else {
$new_permissions_list = $permissions;
}
$deleted = array();
/* first erase all prior permissions */
$oldPermissions = $this->object->getMany('Permissions');
/** @var modAccessPermission $permission */
foreach ($oldPermissions as $permission) {
if (!in_array($permission->get('name'), $new_permissions_list)) {
$deleted[] = $permission->get('name');
}
$permission->remove();
}
$added = array();
foreach ($permissions as $permissionArray) {
if (in_array($permissionArray['name'], $added)) {
continue;
}
$permission = $this->modx->newObject('modAccessPermission');
$permission->set('template', $this->object->get('id'));
$permission->set('name', $permissionArray['name']);
$permission->set('description', $permissionArray['description']);
$permission->set('value', true);
$permission->save();
$added[] = $permissionArray['name'];
}
// update all existing policies if needed
if (!empty($deleted)) {
$policies = $this->object->getMany('Policies');
/** @var modAccessPolicy $policy */
foreach ($policies as $policy) {
$policy_data = $policy->get('data');
foreach ($deleted as $deleted_perm) {
if (isset($policy_data[$deleted_perm])) {
unset($policy_data[$deleted_perm]);
}
}
$policy->set('data', $policy_data);
$policy->save();
}
}
}
return parent::afterSave();
}
示例12: afterSave
/**
* @return bool
*/
public function afterSave()
{
$new_thread = $this->object->get('thread');
if ($this->old_thread != $new_thread) {
$this->object->changeThread($this->old_thread, $new_thread);
} else {
$this->object->clearTicketCache();
}
return parent::afterSave();
}
示例13: afterSave
public function afterSave()
{
$this->action = $this->object->getOne('Action');
$this->clearOldRules();
$this->setFieldRules();
$this->setTabRules();
$this->setTVRules();
$this->saveNewRules();
return parent::afterSave();
}
示例14: afterSave
/**
* @return bool
*/
public function afterSave()
{
$this->object->clearTicketCache();
/* @var TicketThread $thread */
if ($thread = $this->object->getOne('Thread')) {
$thread->updateLastComment();
}
$this->modx->cacheManager->delete('tickets/latest.comments');
$this->modx->cacheManager->delete('tickets/latest.tickets');
return parent::afterSave();
}
示例15: afterSave
public function afterSave()
{
/* выполняем уведомления */
if ($this->object->get('status') != $this->status) {
$this->MlmSystem->Tools->sendNotice($this->object);
}
/* генерируем пути */
if ($this->object->get('parent') != $this->parent) {
$this->MlmSystem->Paths->removePathItem($this->object->get('id'));
$this->MlmSystem->Paths->GeneratePaths($this->object->get('id'));
}
return parent::afterSave();
}