本文整理汇总了PHP中Drupal\Core\Entity\EntityStorageInterface::countMenuLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityStorageInterface::countMenuLinks方法的具体用法?PHP EntityStorageInterface::countMenuLinks怎么用?PHP EntityStorageInterface::countMenuLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityStorageInterface
的用法示例。
在下文中一共展示了EntityStorageInterface::countMenuLinks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDescription
/**
* {@inheritdoc}
*/
public function getDescription()
{
$caption = '';
$num_links = $this->storage->countMenuLinks($this->entity->id());
if ($num_links) {
$caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu link in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu links in %title. They will be deleted (system-defined links will be reset).', array('%title' => $this->entity->label())) . '</p>';
}
$caption .= '<p>' . t('This action cannot be undone.') . '</p>';
return $caption;
}