profil)) { $this->profil = json_encode($this->profil); } return parent::beforeSave($isNew); } /** * {@inheritDoc} * @see \Piko\DbRecord::afterSave() */ protected function afterSave(): void { $this->profil = empty($this->profil) ? [] : json_decode($this->profil, true); parent::afterSave(); } /** * {@inheritDoc} * @see \Piko\DbRecord::load() */ public function load($id = 0): DbRecord { parent::load($id); $this->profil = empty($this->profil) ? [] : json_decode($this->profil, true); return $this; } }