src/models/BaseConfigurationModel.php
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;
    }
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;
    }
Saves state to file
@param string $statePath Path where model state files are stored.
@return bool