You are here

public function MetadataInfoEventSubscriber::setInfo in Filebrowser 3.x

Same name in this branch
  1. 3.x src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser\EventSubscriber\MetadataInfoEventSubscriber::setInfo()
  2. 3.x modules/src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser_extra\EventSubscriber\MetadataInfoEventSubscriber::setInfo()
Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser\EventSubscriber\MetadataInfoEventSubscriber::setInfo()

File

src/EventSubscriber/MetadataInfoEventSubscriber.php, line 22

Class

MetadataInfoEventSubscriber

Namespace

Drupal\filebrowser\EventSubscriber

Code

public function setInfo($event) {

  /** @var MetadataInfo $event */
  $info = [
    Common::ICON => [
      'title' => $this
        ->t('Icon'),
    ],
    Common::NAME => [
      'title' => $this
        ->t('Name'),
      'sortable' => TRUE,
      'type' => 'string',
    ],
    Common::CREATED => [
      'title' => $this
        ->t('Created'),
      //'sortable' => TRUE,
      'type' => 'integer',
    ],
    Common::SIZE => [
      'title' => $this
        ->t('Size'),
      // fixme: formatted size not sortable
      'sortable' => false,
      'type' => 'integer',
    ],
    Common::MIME_TYPE => [
      'title' => $this
        ->t('Mime type'),
      'sortable' => TRUE,
      'type' => 'string',
    ],
    Common::DESCRIPTION => [
      'title' => $this
        ->t('Description'),
      'writable' => TRUE,
      //'sortable' => TRUE,
      'type' => 'string',
    ],
  ];
  $event
    ->setMetaDataInfo($info);
}