public function dataDump($models = null) {
        if (!empty($models)) {
            if (!is_array($models)) $models = array($models);
        } else {
            $models = array_keys($this->_structures);
        }

        $data_dir = $this->_storagePath . 'data/';
        FSService::makeWritable($data_dir);
        foreach ($models as $model) {
            $model     = ucfirst($model);
            $file_name = $data_dir . strtolower($model) . '.yml';
            if (!isset($this->_structures[$model])) continue;

            if (is_file($file_name)) {
                unlink($file_name);
            }
            $data = QC::create($this->_structures[$model]['table'])->execute();
            file_put_contents($file_name, Yaml::dump($data, 6, 2));
        }
    }
public function dataDump($models = null) {
        if (!empty($models)) {
            if (!is_array($models)) $models = array($models);
        } else {
            $models = array_keys($this->_structures);
        }

        $data_dir = $this->_storagePath . 'data/';
        FSService::makeWritable($data_dir);
        foreach ($models as $model) {
            $model     = ucfirst($model);
            $file_name = $data_dir . strtolower($model) . '.yml';
            if (!isset($this->_structures[$model])) continue;

            if (is_file($file_name)) {
                unlink($file_name);
            }
            $data = QC::create($this->_structures[$model]['table'])->execute();
            file_put_contents($file_name, Yaml::dump($data, 6, 2));
        }
    }
public function dataDump ( $ models = null ) { if ( ! empty ( $ models ) ) { if ( ! is_array ( $ models ) ) $ models = array ( $ models ) ; } else { $ models = array_keys ( $ this -> _structures ) ; } $ data_dir = $ this -> _storagePath . 'data/' ; FSService :: makeWritable ( $ data_dir ) ; foreach ( $ models as $ model ) { $ model = ucfirst ( $ model ) ; $ file_name = $ data_dir . strtolower ( $ model ) . '.yml' ; if ( ! isset ( $ this -> _structures [ $ model ] ) ) continue ; if ( is_file ( $ file_name ) ) { unlink ( $ file_name ) ; } $ data = QC :: create ( $ this -> _structures [ $ model ] [ 'table' ] ) -> execute ( ) ; file_put_contents ( $ file_name , Yaml :: dump ( $ data , 6 , 2 ) ) ; } }
Dumps current database data to YML files
@param string|array $models
Dumps current database data to YML files