protected function afterFind() { $this->originalAttributes = $this->getAttributes(); if (isset($this->active)) { $this->active = (bool) $this->active; } parent::afterFind(); }