public function saveState($statePath)
    {
        $filename = Yii::getAlias($statePath . $this->stateFilename() . '.php');
        $writer = new ApplicationConfigWriter([
            'filename' => $filename,
        ]);
        $writer->configuration = $this->getAttributesForStateSaving();
        $result =  $writer->commit();
        return $result;
    }