You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xPDOGenerator.writeSchema currently takes four values: file name, package name, base class, and prefix. Adding two more would extend the capabilities: restrict to prefix (boolean), and table list (comma-separated list of table names).
Why is it needed?
When developing custom tables, it would nice to be able to use a script to auto-generate the schema for just those tables as part of a package. Currently, it's all or nothing; all tables in the specified prefix get included in the schema for the package you specify, which is not what we want for custom tables. Only using a custom prefix instead of the default MODX table prefix enables making the schema for just the custom tables.
Bob Ray's script CreateXpdoClasses is very useful, and already has the ability to specify tables built in, but that won't work until writeSchema is updated. Here's a note he put in that script:
/* boolean writeSchema (
* string $schemaFile, // Full path to the schema file you want to write
* [string $package = ''], // Name of your component
* [string $baseClass = ''], // xPDO base class to use;
* send '' if using args below
* [string $tablePrefix = ''], // Table prefix (of tables to process)
* [boolean $restrictPrefix = false]), // Process only tables
* with $tablePrefix
* [mixed $tableList = '' // Array of arrays of
* full-table-name=>className or
* a string with a comma-separated
* list of full table names;
* if you send the string the table
* name will be used as the class name.
*/
The text was updated successfully, but these errors were encountered:
Feature request
Summary
xPDOGenerator.writeSchema currently takes four values: file name, package name, base class, and prefix. Adding two more would extend the capabilities: restrict to prefix (boolean), and table list (comma-separated list of table names).
Why is it needed?
When developing custom tables, it would nice to be able to use a script to auto-generate the schema for just those tables as part of a package. Currently, it's all or nothing; all tables in the specified prefix get included in the schema for the package you specify, which is not what we want for custom tables. Only using a custom prefix instead of the default MODX table prefix enables making the schema for just the custom tables.
Bob Ray's script CreateXpdoClasses is very useful, and already has the ability to specify tables built in, but that won't work until writeSchema is updated. Here's a note he put in that script:
The text was updated successfully, but these errors were encountered: