/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { if ($this->indexUrl != null) { Yii::$app->getModule('space')->settings->contentContainer($this)->set('indexUrl', $this->indexUrl); } else { //Remove entry from db Yii::$app->getModule('space')->settings->contentContainer($this)->delete('indexUrl'); } return parent::afterSave($insert, $changedAttributes); }