xPDOManager.addField
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn morexPDOManager::addField¶
Adds a column to the table of a class. The $options array describes the column; see getColumnDef() in the driver manager for the accepted keys.
Syntax¶
boolean addField (string $class, string $name, [array $options = array()])
Example¶
$manager = $xpdo->getManager();
$manager->addField('MyVendor\\MyPackage\\MyModel', 'subtitle', array(
'dbtype' => 'varchar',
'precision' => '255',
'phptype' => 'string',
'null' => true,
));
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










