本文整理汇总了PHP中Drupal\Core\Entity\EntityInterface::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityInterface::getTitle方法的具体用法?PHP EntityInterface::getTitle怎么用?PHP EntityInterface::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityInterface
的用法示例。
在下文中一共展示了EntityInterface::getTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
function __construct(EntityInterface $entity)
{
$this->queue = new \Celery('localhost', 'guest', 'guest', '/');
$this->id = $entity->getRevisionId();
$this->ref_id = $entity->nid->value;
$this->name = $entity->getTitle();
$this->type = $entity->bundle();
// Host Definition
$this->host_def_vars = $this->getHostDefinition($entity);
$this->host_def_vars['ran_name'] = $this->name;
$this->host_def_type = $this->host_def_vars['_system_type'];
unset($this->host_def_vars['_system_type']);
// Host Configuration
$this->host_conf_vars = $this->getHostConfiguration($entity);
$this->host_conf_types = $this->host_conf_vars['_roles'];
unset($this->host_conf_vars['_roles']);
// Host Description
$this->description = 'Generated by Rán.';
$desc = $entity->getFields()['field_ran__description']->getString();
if (isset($this->vars['_description'])) {
$this->description = $this->vars['_description'];
unset($this->vars['_description']);
}
$this->org = 'root';
$this->project = 'default';
$this->extra_vars = json_encode(array('ran_name' => $this->name, 'ran_desc' => $this->description, 'ran_type' => $this->type, 'ran_def_type' => $this->host_def_type, 'ran_def_vars' => $this->host_def_vars, 'ran_conf_types' => $this->host_conf_types, 'ran_conf_vars' => $this->host_conf_vars), JSON_UNESCAPED_UNICODE);
}
示例2: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$links = array('edit' => array('title' => t('Edit'), 'url' => Url::fromRoute('entity.empty_page.edit_form', ['empty_page' => $entity->getName()])), 'delete' => array('title' => t('Delete'), 'url' => Url::fromRoute('entity.empty_page.delete_form', ['empty_page' => $entity->getName()])));
$row = array('title' => array('data' => $entity->getTitle()), 'name' => array('data' => $entity->getName()), 'path' => array('data' => array('#type' => 'link', '#title' => $entity->getPath(), '#url' => Url::fromUri('base://' . $entity->getPath()), '#options' => array('html' => TRUE))), 'operations' => array('data' => array('#type' => 'operations', '#links' => $links)));
return $row + parent::buildRow($entity);
}