Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Temporarily disable observers
Is there a way to temporarily disable all ORM observers, without for example commenting them all?
Something like this would be the cleanest solution:
protected $_observers_enabled = true;
public static observer_state($state = true)
static::$_observers_enabled = (boot) $state;
public function observe($event)
static::$_observers_enabled and parent::observe($event);
I know this old, but this helped me a lot. We needed to create an import function and in this situation I needed to set the created_at, update_by, etc with past dates. Thanks guys
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion