You are here

protected function MenuLinkConfiguration::prepareBuild in Configuration Management 7.2

Overrides Drupal\configuration\Config\Configuration::prepareBuild().

Overrides Configuration::prepareBuild

File

lib/Drupal/configuration/Config/MenuLinkConfiguration.php, line 148
Definition of Drupal\configuration\Config\FieldConfiguration.

Class

MenuLinkConfiguration

Namespace

Drupal\configuration\Config

Code

protected function prepareBuild() {
  $mlid = static::getMenuLinkByIdenfifier($this
    ->getIdentifier(), TRUE);
  $this->data = menu_link_load($mlid);
  $this->data['parent_identifier'] = NULL;
  if (!empty($this->data['plid'])) {
    $parent = db_select('menu_links', 'ml')
      ->fields('ml', array(
      'menu_name',
      'link_path',
      'mlid',
    ))
      ->condition('mlid', $this->data['plid'])
      ->execute()
      ->fetchObject();
    if (!empty($parent)) {
      $this->data['parent_identifier'] = sha1(str_replace('-', '_', $parent->menu_name) . ':' . $parent->link_path);
    }
  }
  return $this;
}