You are here

function homebox_homebox_insert in Homebox 8

Implements hook_ENTITY_TYPE_insert().

File

./homebox.module, line 51
Homebox module hooks.

Code

function homebox_homebox_insert(EntityInterface $entity) {

  // @todo Check for existing aliases with the same alias name.

  /* @var \Drupal\homebox\Entity\HomeboxInterface $entity */
  \Drupal::service('path.alias_storage')
    ->save('/homebox-page/' . $entity
    ->id() . '/' . \Drupal::currentUser()
    ->id(), '/' . $entity
    ->getPath(), "en");
}