[RSS Feed/News] Option to disable __preSave()/__postSave() from running when record is created or updated

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
Let's say as part of an addon, I've a custom entity created. In the structure class, I've declared either a __preSave() or a __postSave() or both.

In certain scenarios, there would be a need to not run these functions (use case shown below).

PHP:

Code:
protected function __preSave()
{
    $this->updated_by = \XF::visitor()->user_id;
}

Now, I've a part of code that is updating value of a row and in this particular case, I do not want the __preSave() to run.
PHP:

$foo =...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom