public final function setEnabled($boolean = true) { if ($this->isEnabled !== $boolean) { $this->isEnabled = $boolean; if ($this->isEnabled === true) { $this->onEnable(); } else { $this->onDisable(); } } }