for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ORM\Entity;
trait EventHandlers
{
/**
* Empty event handler
*
* Get called when the entity get initialized.
* @param bool $new Whether or not the entity is new or from database
* @codeCoverageIgnore dummy event handler
*/
public function onInit($new)
$new
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
}
* Get called when something is changed with magic setter.
* @param string $attribute The variable that got changed.merge(node.inheritedProperties)
* @param mixed $oldValue The old value of the variable
* @param mixed $value The new value of the variable
public function onChange($attribute, $oldValue, $value)
$attribute
$oldValue
$value
* Get called before the entity get inserted in database.
public function prePersist()
* Get called before the entity get updated in database.
public function preUpdate()
* Get called after the entity got inserted in database.
public function postPersist()
* Get called after the entity got updated in database.
public function postUpdate()
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.