You are here

pathauto_menu_link.module in Pathauto Menu Link 8

Same filename and directory in other branches
  1. 7 pathauto_menu_link.module

Main file for the Pathauto Menu Link module.

File

pathauto_menu_link.module
View source
<?php

/**
 * @file
 * Main file for the Pathauto Menu Link module.
 */
use Drupal\Core\Entity\EntityInterface;

/**
 * Implements hook_ENTITY_TYPE_update().
 */
function pathauto_menu_link_menu_link_content_update(EntityInterface $entity) {
  $menu_link_id = $entity
    ->id();
  $link = $entity
    ->get('link')
    ->first();
  if ($link
    ->isExternal()) {
    return;
  }
  $link_values = $link
    ->getValue();
  list($entity_type_id, $entity_id) = explode('/', $link_values['uri'], 2);
}