本文整理汇总了PHP中Drupal\Core\Entity\EntityInterface::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityInterface::getStatus方法的具体用法?PHP EntityInterface::getStatus怎么用?PHP EntityInterface::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityInterface
的用法示例。
在下文中一共展示了EntityInterface::getStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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);
}