本文整理汇总了PHP中Drupal\Core\Entity\EntityInterface::getChangedTime方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityInterface::getChangedTime方法的具体用法?PHP EntityInterface::getChangedTime怎么用?PHP EntityInterface::getChangedTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityInterface
的用法示例。
在下文中一共展示了EntityInterface::getChangedTime方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
/** @var \Drupal\node\NodeInterface $entity */
$mark = array('#theme' => 'mark', '#mark_type' => node_mark($entity->id(), $entity->getChangedTime()));
$langcode = $entity->language()->getId();
$uri = $entity->urlInfo();
$options = $uri->getOptions();
$options += $langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? array('language' => $languages[$langcode]) : array();
$uri->setOptions($options);
$row['title']['data'] = array('#type' => 'link', '#title' => $entity->label(), '#suffix' => ' ' . drupal_render($mark), '#url' => $uri);
$row['type'] = node_get_type_label($entity);
$row['author']['data'] = array('#theme' => 'username', '#account' => $entity->getOwner());
$row['status'] = $entity->isPublished() ? $this->t('published') : $this->t('not published');
$row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
$language_manager = \Drupal::languageManager();
if ($language_manager->isMultilingual()) {
$row['language_name'] = $language_manager->getLanguageName($langcode);
}
$row['operations']['data'] = $this->buildOperations($entity);
return $row + parent::buildRow($entity);
}
示例2: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
/** @var \Drupal\profile\Entity\ProfileInterface $entity */
$mark = ['#theme' => 'mark', '#mark_type' => node_mark($entity->id(), $entity->getChangedTime())];
$langcode = $entity->language()->id;
$uri = $entity->toUrl();
$options = $uri->getOptions();
$options += $langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? ['language' => $languages[$langcode]] : [];
$uri->setOptions($options);
$row['label']['data'] = ['#type' => 'link', '#title' => $entity->label(), '#suffix' => ' ' . $this->renderer->render($mark)] + $uri->toRenderArray();
$row['type'] = $entity->getType()->id();
$row['owner']['data'] = ['#theme' => 'username', '#account' => $entity->getOwner()];
$row['status'] = $entity->isActive() ? $this->t('active') : $this->t('not active');
$row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
$language_manager = \Drupal::languageManager();
if ($language_manager->isMultilingual()) {
$row['language_name'] = $language_manager->getLanguageName($langcode);
}
$route_params = ['user' => $entity->getOwnerId(), 'type' => $entity->bundle(), 'profile' => $entity->id()];
$links['edit'] = ['title' => t('Edit'), 'route_name' => 'entity.profile.edit_form', 'route_parameters' => $route_params];
$links['delete'] = ['title' => t('Delete'), 'route_name' => 'entity.profile.delete_form', 'route_parameters' => $route_params];
$row[] = ['data' => ['#type' => 'operations', '#links' => $links]];
return $row + parent::buildRow($entity);
}
示例3: getChangedTime
/**
* {@inheritdoc}
*/
public function getChangedTime()
{
return $this->translation->hasField('content_translation_changed') ? $this->translation->get('content_translation_changed')->value : $this->translation->getChangedTime();
}
示例4: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\commerce_payment\Entity\PaymentInfo */
$paymentInfoType = PaymentInfoType::load($entity->bundle());
$row = array(
'information_id' => $entity->id(),
'payment_method' => $paymentInfoType->label(),
'owner' => array(
'data' => array(
'#theme' => 'username',
'#account' => $entity->getOwner(),
),
),
'status' => $entity->getStatus(),
'created' => $this->dateFormatter->format($entity->getCreatedTime(), 'short'),
'changed' => $this->dateFormatter->format($entity->getChangedTime(), 'short'),
);
return $row + parent::buildRow($entity);
}
示例5: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
/** @var \Drupal\profile\Entity\ProfileInterface $entity */
$langcode = $entity->language()->getId();
$uri = $entity->toUrl();
$options = $uri->getOptions();
$options += $langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? ['language' => $languages[$langcode]] : [];
$uri->setOptions($options);
$row['label'] = $entity->link();
$row['type'] = $entity->getType();
$row['owner']['data'] = ['#theme' => 'username', '#account' => $entity->getOwner()];
$row['status'] = $entity->isActive() ? $this->t('active') : $this->t('not active');
$row['is_default'] = $entity->isDefault() ? $this->t('default') : $this->t('not default');
$row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
$language_manager = \Drupal::languageManager();
if ($language_manager->isMultilingual()) {
$row['language_name'] = $language_manager->getLanguageName($langcode);
}
return $row + parent::buildRow($entity);
}
示例6: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\commerce_order\Entity\Order */
$orderType = OrderType::load($entity->bundle());
$row = [
'order_id' => $entity->id(),
'type' => $orderType->label(),
'owner' => [
'data' => [
'#theme' => 'username',
'#account' => $entity->getOwner(),
],
],
'status' => $entity->getStatus(),
'created' => $this->dateFormatter->format($entity->getCreatedTime(), 'short'),
'changed' => $this->dateFormatter->format($entity->getChangedTime(), 'short'),
];
return $row + parent::buildRow($entity);
}
示例7: buildRow
/**
* {@inheritdnoc}
*/
public function buildRow(EntityInterface $payment)
{
/** @var \Drupal\payment\Entity\PaymentInterface $payment */
$row['data']['updated'] = $this->dateFormatter->format($payment->getChangedTime());
$status_definition = $payment->getPaymentStatus()->getPluginDefinition();
$row['data']['status'] = $status_definition['label'];
/** @var \Drupal\currency\Entity\CurrencyInterface $currency */
$currency = $this->currencyStorage->load($payment->getCurrencyCode());
if (!$currency) {
$currency = $this->currencyStorage->load('XXX');
}
$row['data']['amount'] = $currency->formatAmount($payment->getAmount());
$row['data']['payment_method'] = $payment->getPaymentMethod() ? $payment->getPaymentMethod()->getPluginDefinition()['label'] : $this->t('Unavailable');
$row['data']['owner']['data'] = array('#theme' => 'username', '#account' => $payment->getOwner());
$operations = $this->buildOperations($payment);
$row['data']['operations']['data'] = $operations;
return $row;
}