Passing options from save to model

hi,

I am trying to pass variables to afterSaveCommit. My code below doesn’t pass the variable/options. Can someone please point me to the right docs ?

Here is what I tried :

// in controller
$this->Articles->save( $entity, ['variable' => 'my variable'] );

// in ArticlesTable.php
public function afterSaveCommit(Event $event, EntityInterface $entity, ArrayObject $options)
{
	//debug( $event );
	//debug( $entity );
	debug( $options );
}

Output :

APP/Model/Table/ArticlesTable.php (line 54)
  object(ArrayObject) id:0 {
}

Thanks

Try debug($options->getArrayCopy());

I can see my variable now. Thanks

output

APP/Model/Table/ArticlesTable.php (line 55)
[
  'variable' => 'my variable',
  'atomic' => true,
  'associated' => [
    'Users' => [ ],
    'Tags' => [ ],
  ],
  'checkRules' => true,
  'checkExisting' => true,
  '_primary' => true,
]