Closed jarednipper closed 1 year ago
I see that you are already thinking about this.
I'm considering adding a fFixturedump($root, $tables) method that uses these methods to build JSON fixture files. Maybe with some limiting options in case of huge datasets.
How about just passing it an fRecordSet?
Some I make by hand other I use existing data and dumping it to json. Check second comment here:
http://flourishlib.com/discussion/2/595/1700
Got it?
I'm considering adding a method that will build fORMJSON to dump larger amount of data. A method signature something like this:
/**
* Dumps an existing database into mulitiple fixture files.
*
* @param $root
* The directory in which to dump the fixture files.
* @param $tables
* An array of table names to dump.
* @param $limits
* An associative array of table names as keys and values that are the max limit of records to dump.
* @param $dont_follow_dependencies
* In case of foreign key constraints you can opt not to follow the relation and only create the fixtures from $tables.
*/
static public function dump($root, $tables = array(), $limits = array(), $dont_follow_dependencies = FALSE)
{
}
Yeah that woud leave out $tables and $limits
static public function dump($root, $record_set, $dont_follow_dependencies);
However focusing on table level allows you change to a more efficient implementation for large data sets. But you could have both:
static public function dump($root, $tables = array(), $limits = array(), $dont_follow_dependencies = FALSE)
static public function dumpRecords($root, $record_set, $dont_follow_dependencies = FALSE)
Oh cool! I didn't know about fORMJSON::extend().
You can close this non-issue if you want.
How are you generating the json files?