当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityInterface::getChangedTime方法代码示例

本文整理汇总了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);
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:24,代码来源:NodeListBuilder.php

示例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);
 }
开发者ID:darrylri,项目名称:protovbmwmo,代码行数:27,代码来源:ProfileListBuilder.php

示例3: getChangedTime

 /**
  * {@inheritdoc}
  */
 public function getChangedTime()
 {
     return $this->translation->hasField('content_translation_changed') ? $this->translation->get('content_translation_changed')->value : $this->translation->getChangedTime();
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:7,代码来源:ContentTranslationMetadataWrapper.php

示例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);
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:22,代码来源:PaymentInfoListBuilder.php

示例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);
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:23,代码来源:ProfileListBuilder.php

示例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);
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:22,代码来源:OrderListBuilder.php

示例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;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:21,代码来源:PaymentListBuilder.php


注:本文中的Drupal\Core\Entity\EntityInterface::getChangedTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。