dateFormatter = $date_formatter; } /** * {@inheritdoc} */ public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('date.formatter') ); } /** * {@inheritdoc} */ public function buildHeader() { $header['label'] = t('Name'); $header['pattern'] = t('Pattern'); return $header + parent::buildHeader(); } /** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { $row['label'] = $entity->label(); $row['pattern'] = $this->dateFormatter->format(REQUEST_TIME, $entity->id()); return $row + parent::buildRow($entity); } }