protected function MenuTreeStorage::prepareLink

protected MenuTreeStorage::prepareLink(array $link, $intersect = FALSE)

Prepares a link by unserializing values and saving the definition.

Parameters

array $link: The data loaded in the query.

bool $intersect: If TRUE, filter out values that are not part of the actual definition.

Return value

array The prepared link data.

File

core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 627

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

protected function prepareLink(array $link, $intersect = FALSE) {
  foreach ($this->serializedFields() as $name) {
    if (isset($link[$name])) {
      $link[$name] = unserialize($link[$name]);
    }
  }
  if ($intersect) {
    $link = array_intersect_key($link, array_flip($this->definitionFields()));
  }
  $this->definitions[$link['id']] = $link;
  return $link;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuTreeStorage.php/function/MenuTreeStorage::prepareLink/8.1.x