public static function MaestroProcessVariables::preCreate in Maestro 8.2
Same name and namespace in other branches
- 3.x src/Entity/MaestroProcessVariables.php \Drupal\maestro\Entity\MaestroProcessVariables::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/ MaestroProcessVariables.php, line 56
Class
- MaestroProcessVariables
- Defines the MaestroProcessVariables 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(),
];
}