public static function MaestroProcess::preCreate in Maestro 3.x
Same name and namespace in other branches
- 8.2 src/Entity/MaestroProcess.php \Drupal\maestro\Entity\MaestroProcess::preCreate()
When a new entity instance is added, set the user_id entity reference to the current user as the creator of the instance.
Overrides EntityBase::preCreate
File
- src/
Entity/ MaestroProcess.php, line 59
Class
- MaestroProcess
- Defines the MaestroProcess entity.
Namespace
Drupal\maestro\EntityCode
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += [
'user_id' => \Drupal::currentUser()
->id(),
];
}