public function getAvailableSorts() { return [ 'media_field_data-name:DESC' =>
$this->
t('Media name'
),
];
} /**
* {@inheritdoc}
*/
protected function defaultDisplayOptions() { $display_options = parent::
defaultDisplayOptions();
// Add permission-based access control.
$display_options['access'
]['type'
] = 'perm';
$display_options['access'
]['options'
]['perm'
] = 'view media';
// Remove the default fields, since we are customizing them here.
unset($display_options['fields'
]);
// Add the name field, so that the display has content if the user switches
// to a row style that uses fields.
$display_options['fields'
]['name'
]['id'
] = 'name';