public static function Flipbook::preCreate in 3D Flipbook 8
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/ Flipbook.php, line 137
Class
- Flipbook
- Defines the Flipbook entity.
Namespace
Drupal\flipbook\EntityCode
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += [
'user_id' => \Drupal::currentUser()
->id(),
];
}