MenuLinkContent::isExpanded

public MenuLinkContent::isExpanded() Returns whether the menu link is marked as always expanded. Return value bool TRUE for expanded, FALSE otherwise. Overrides MenuLinkContentInterface::isExpanded File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 112 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function isExpanded() { return (bool) $this->get('expanded')->value; }

MenuLinkContent::isEnabled

public MenuLinkContent::isEnabled() Returns whether the menu link is marked as enabled. Return value bool TRUE if is enabled, otherwise FALSE. Overrides MenuLinkContentInterface::isEnabled File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 105 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function isEnabled() { return (bool) $this->get('enabled')->value; }

MenuLinkContent::getWeight

public MenuLinkContent::getWeight() Returns the weight of the menu link content entity. Return value int A weight for use when ordering links. Overrides MenuLinkContentInterface::getWeight File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 128 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getWeight() { return (int) $this->get('weight')->value; }

MenuLinkContent::getUrlObject

public MenuLinkContent::getUrlObject() Gets the url object pointing to the URL of the menu link content entity. Return value \Drupal\Core\Url A Url object instance. Overrides MenuLinkContentInterface::getUrlObject File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 77 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getUrlObject() { return $this->link->first()->getUrl(); }

MenuLinkContent::getTitle

public MenuLinkContent::getTitle() Gets the title of the menu link. Return value string The title of the link. Overrides MenuLinkContentInterface::getTitle File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 70 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getTitle() { return $this->get('title')->value; }

MenuLinkContent::getParentId

public MenuLinkContent::getParentId() Gets the plugin ID of the parent menu link. Return value string A plugin ID, or empty string if this link is at the top level. Overrides MenuLinkContentInterface::getParentId File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 119 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getParentId() { // Cast the parent ID to a string, only an empty str

MenuLinkContent::getMenuName

public MenuLinkContent::getMenuName() Gets the menu name of the custom menu link. Return value string The menu ID. Overrides MenuLinkContentInterface::getMenuName File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 84 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getMenuName() { return $this->get('menu_name')->value; }

MenuLinkContent::getDescription

public MenuLinkContent::getDescription() Gets the description of the menu link for the UI. Return value string The description to use on admin pages or as a title attribute. Overrides MenuLinkContentInterface::getDescription File core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 91 Class MenuLinkContent Defines the menu link content entity class. Namespace Drupal\menu_link_content\Entity Code public function getDescription() { return $this->get('description')-&g

MenuLinkContent::baseFieldDefinitions

public static MenuLinkContent::baseFieldDefinitions(EntityTypeInterface $entity_type) Provides base field definitions for an entity type. Implementations typically use the class \Drupal\Core\Field\BaseFieldDefinition for creating the field definitions; for example a 'name' field could be defined as the following: $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')); By definition, base fields are fields that exist for every bundle. To provide definitions for fiel

MenuLinkContent

Defines the menu link content entity class. @property \Drupal\link\LinkItemInterface link @property \Drupal\Core\Field\FieldItemList rediscover Plugin annotation @ContentEntityType( id = "menu_link_content", label = @Translation("Custom menu link"), handlers = { "storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage", "storage_schema" = "Drupal\menu_link_content\MenuLinkContentStorageSchema", "access" = "Drupal\menu_link_content\MenuLinkContentAccessControlHandler", "