MenuLink.php in Open Social 8.8
Same filename and directory in other branches
- 8.9 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.2 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.3 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.4 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.5 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.6 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 8.7 modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
- 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.php
Namespace
Drupal\social_demo\Plugin\DemoContentFile
modules/custom/social_demo/src/Plugin/DemoContent/MenuLink.phpView source
<?php
namespace Drupal\social_demo\Plugin\DemoContent;
use Drupal\social_demo\DemoEntity;
/**
* MenuLink Plugin for demo content.
*
* @DemoContent(
* id = "link",
* label = @Translation("Menu link"),
* source = "content/entity/menu-link.yml",
* entity_type = "menu_link_content"
* )
*/
class MenuLink extends DemoEntity {
/**
* {@inheritdoc}
*/
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,
];
}
}