modX.logManagerAction
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 moremodX::logManagerAction¶
Creates and saves a modManagerLog record for one action. Processors call it right after they change an object, and the rows appear under Reports → Manager Actions.
Empty arguments are stored as:
| Argument | Stored as |
|---|---|
$action |
'unknown' |
$class_key |
'' |
$item |
'unknown' |
The method returns the saved object, or null when the save fails after an error was logged.
Syntax¶
modManagerLog|null logManagerAction (string $action, string $class_key, mixed $item, [int|null $userId = null])
-
$action(string) action key stored in the row -
$class_key(string) class key of the affected object -
$item(mixed) identifier stored asitem -
$userId(int|null) acting user; by defaultnulluses the id ofmodX::$user
Example¶
$log = $modx->logManagerAction('update_resource', modResource::class, 5);
if ($log === null) {
// the row was not saved
}
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










