You are here

public function MenuLink::getEntry in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  2. 8 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  3. 8.2 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  4. 8.4 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  5. 8.5 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  6. 8.6 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  7. 8.7 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  8. 8.8 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  9. 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  10. 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  11. 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()
  12. 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php \Drupal\social_demo\Plugin\DemoContent\MenuLink::getEntry()

Makes an array with data of an entity.

Parameters

array $item: Array with items.

Return value

array Returns an array.

Overrides DemoEntity::getEntry

File

modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php, line 22

Class

MenuLink
MenuLink Plugin for demo content.

Namespace

Drupal\social_demo\Plugin\DemoContent

Code

public function getEntry(array $item) {
  $entry = parent::getEntry($item);
  return $entry + [
    'title' => $item['title'],
    'link' => [
      'uri' => $item['link'],
    ],
    'menu_name' => $item['menu_name'],
    'expanded' => $item['expanded'],
    'weight' => isset($item['weight']) ? $item['weight'] : 0,
  ];
}