modUser.save
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 moremodUser::save¶
Saves the object and wraps the xPDO save in the two User events. A new object whose createdon is below 1 gets the current timestamp first.
Both events fire only when the xpdo instance is a modX. OnUserSave fires only if the parent save succeeded; OnUserBeforeSave fires before the attempt either way.
Syntax¶
boolean save ([boolean $cacheFlag = false])
-
$cacheFlag(boolean) Passed toxPDOObject::save(); by defaultfalse. An integer value is a cache lifetime in seconds.
Example¶
$user = $modx->getObject('modUser', array('username' => 'foobar'));
$user->set('active', 1);
$user->save();
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










