Jump to content

getChanges


nabo
 Share

Recommended Posts

Hello

this is my script

public function recordUserModifications() {
		$this->addHookBefore('Users::saveReady', function($event) {
			$page = $event->arguments('page');
			$page->setTrackChanges(Wire::trackChangesValues);
			$page->setTrackChanges(true);
			$new_changes = $page->getChanges(true);
			die(var_dump($new_changes));
		});
  }

and this is the result, when I change name and email

array(2) { ["name"]=> array(1) { [0]=> NULL } ["email"]=> array(1) { [0]=> NULL } }

I expect an associative array containing an array of previous values, indexed by property name, oldest to newest, but it's NULL.

Thanks if you have some suggestions

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...