Browse Source
* Removing duplicate delete media action * Torching test * Update hook * Coding standardspull/729/head
dannylamb
6 years ago
committed by
Mark Jordan
5 changed files with 12 additions and 77 deletions
@ -1,13 +0,0 @@
|
||||
langcode: en |
||||
status: true |
||||
dependencies: |
||||
enforced: |
||||
module: |
||||
- islandora |
||||
module: |
||||
- islandora |
||||
id: delete_media |
||||
label: 'Delete media' |
||||
type: media |
||||
plugin: delete_media |
||||
configuration: { } |
@ -1,35 +0,0 @@
|
||||
<?php |
||||
|
||||
namespace Drupal\islandora\Plugin\Action; |
||||
|
||||
use Drupal\Core\Action\ActionBase; |
||||
use Drupal\Core\Session\AccountInterface; |
||||
|
||||
/** |
||||
* Deletes a media. |
||||
* |
||||
* @Action( |
||||
* id = "delete_media", |
||||
* label = @Translation("Delete media"), |
||||
* type = "media" |
||||
* ) |
||||
*/ |
||||
class DeleteMedia extends ActionBase { |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function execute($entity = NULL) { |
||||
if ($entity) { |
||||
$entity->delete(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { |
||||
return $object->access('delete', $account, $return_as_object); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue