/** * Save current table definitions to a file * * This is intended for developer use when setting up the migration by using the current database state * * @internal intended for module developers only * * @return int|false count of bytes written or false on error */ public function saveCurrentSchema() { $this->tableHandler = new Tables(); // start fresh $schema = $this->getCurrentSchema(); foreach ($schema as $tableName => $tableData) { unset($schema[$tableName]['name']); } return Yaml::save($schema, $this->tableDefinitionFile); }
/** * Save table data to a YAML file * * @param string $table name of table to load without prefix * @param string $yamlFile name of file containing data dump in YAML format * @param \CriteriaElement $criteria optional criteria * @param string[] $skipColumns do not include columns in this list * * @return bool true on success, false on error */ public static function saveTableToYamlFile($table, $yamlFile, $criteria = null, $skipColumns = array()) { $rows = static::extractRows($table, $criteria, $skipColumns); $count = Yaml::save($rows, $yamlFile); return false !== $count; }