diff --git a/core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php b/core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php index 487f6ec..a998067 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php +++ b/core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php @@ -15,14 +15,14 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Determines the menu link parent plugin IDs. - * - * The menu_link_parent process plugin figures out menu link parent plugin IDs. + * Determines the parent of a menu link. * * The source is an array of three values: - * - parent_id: The parent link ID (plid) is the mlid of the link above in the hierarchy, or zero if the link is at the top level in its menu. - * - menu_name: The menu name. All links with the same menu name (such as 'navigation') are part of the same menu. - * - parent_link_path: The Drupal path or external path this link points to. + * - parent_id: The numeric ID of the parent menu link, or 0 if the link is at + * the top level of its menu. + * - menu_name: The menu name. All links with the same menu name (such as + * 'navigation') are part of the same menu. + * - parent_link_path: The Drupal path or external URL this link points to. * * Example: * @@ -31,11 +31,16 @@ * parent: * plugin: menu_link_parent * source: - * - plid - * - menu_name - * - parent_link_path + * - '20' + * - 'admin' + * - 'admin/structure' * @endcode * + * In this example the parent_id of '20' will be looked up and returned from + * amongst the already migrated IDs. If it is not found then the + * parent_link_path of 'admin/structure' is loaded from the 'admin' menu, the + * given menu_name. + * * @see \Drupal\migrate\Plugin\MigrateProcessInterface * * @MigrateProcessPlugin( @@ -85,24 +90,7 @@ public static function create(ContainerInterface $container, array $configuratio } /** - * - * Find the parent link GUID. - * Performs the associated process. - * - * @param string $value - * The input string. - * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable - * The migration in which this process is being executed. - * @param \Drupal\migrate\Row $row - * The row from the source to process. - * @param string $destination_property - * The destination property currently worked on. This is only used together - * with the $row above. - * - * @return string - * The sub string of $value. - * - * @throws \Drupal\migrate\MigrateSkipRowException + * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $parent_id = array_shift($value);