Remove unnecessary injection from AssetReorderController.php
This commit is contained in:
parent
b3be5b0755
commit
b628547d6e
|
@ -5,7 +5,6 @@ namespace Drupal\farm_ui_location\Controller;
|
||||||
use Drupal\asset\Entity\AssetInterface;
|
use Drupal\asset\Entity\AssetInterface;
|
||||||
use Drupal\Core\Access\AccessResult;
|
use Drupal\Core\Access\AccessResult;
|
||||||
use Drupal\Core\Controller\ControllerBase;
|
use Drupal\Core\Controller\ControllerBase;
|
||||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
|
||||||
use Drupal\Core\Session\AccountInterface;
|
use Drupal\Core\Session\AccountInterface;
|
||||||
use Drupal\Core\Url;
|
use Drupal\Core\Url;
|
||||||
use Drupal\farm_location\AssetLocationInterface;
|
use Drupal\farm_location\AssetLocationInterface;
|
||||||
|
@ -16,13 +15,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
*/
|
*/
|
||||||
class AssetReorderController extends ControllerBase implements AssetReorderControllerInterface {
|
class AssetReorderController extends ControllerBase implements AssetReorderControllerInterface {
|
||||||
|
|
||||||
/**
|
|
||||||
* The entity type manager.
|
|
||||||
*
|
|
||||||
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
|
|
||||||
*/
|
|
||||||
protected $entityTypeManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The asset location service.
|
* The asset location service.
|
||||||
*
|
*
|
||||||
|
@ -33,13 +25,10 @@ class AssetReorderController extends ControllerBase implements AssetReorderContr
|
||||||
/**
|
/**
|
||||||
* The controller constructor.
|
* The controller constructor.
|
||||||
*
|
*
|
||||||
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
|
|
||||||
* The entity type manager.
|
|
||||||
* @param \Drupal\farm_location\AssetLocationInterface $asset_location
|
* @param \Drupal\farm_location\AssetLocationInterface $asset_location
|
||||||
* The asset location service.
|
* The asset location service.
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityTypeManagerInterface $entity_type_manager, AssetLocationInterface $asset_location) {
|
public function __construct(AssetLocationInterface $asset_location) {
|
||||||
$this->entityTypeManager = $entity_type_manager;
|
|
||||||
$this->assetLocation = $asset_location;
|
$this->assetLocation = $asset_location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +37,6 @@ class AssetReorderController extends ControllerBase implements AssetReorderContr
|
||||||
*/
|
*/
|
||||||
public static function create(ContainerInterface $container) {
|
public static function create(ContainerInterface $container) {
|
||||||
return new static(
|
return new static(
|
||||||
$container->get('entity_type.manager'),
|
|
||||||
$container->get('asset.location')
|
$container->get('asset.location')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +196,7 @@ class AssetReorderController extends ControllerBase implements AssetReorderContr
|
||||||
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
|
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
|
||||||
*/
|
*/
|
||||||
protected function getLocations(AssetInterface $asset = NULL) {
|
protected function getLocations(AssetInterface $asset = NULL) {
|
||||||
$storage = $this->entityTypeManager->getStorage('asset');
|
$storage = $this->entityTypeManager()->getStorage('asset');
|
||||||
$query = $storage->getQuery();
|
$query = $storage->getQuery();
|
||||||
$query->condition('is_location', TRUE);
|
$query->condition('is_location', TRUE);
|
||||||
$query->condition('status', 'archived', '!=');
|
$query->condition('status', 'archived', '!=');
|
||||||
|
|
Loading…
Reference in New Issue