Jump to main content Jump to doc navigation

modX::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 as item
  • $userId (int|null) acting user; by default null uses the id of modX::$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

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • Alex
  • A. Moreno
  • Chris Fickling
  • Stéphane Jäggi
  • Murray Wood
  • Anton Tarasov
  • JT Skaggs
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • YJ
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$194 per month—let's make that $500!

Learn more