DeleteMerciLineItem.php in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2
File
modules/merci_line_item/src/Plugin/Action/DeleteMerciLineItem.php
View source
<?php
namespace Drupal\merci_line_item\Plugin\Action;
use Drupal\merci_line_item\MerciLineItemActionBase;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\user\PrivateTempStoreFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
class DeleteMerciLineItem extends MerciLineItemActionBase implements ContainerFactoryPluginInterface {
public function __construct(array $configuration, $plugin_id, $plugin_definition, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user) {
$this->currentUser = $current_user;
$this->tempStore = $temp_store_factory
->get('merci_line_item_multiple_delete_confirm');
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
return $object
->access('delete', $account, $return_as_object);
}
}