Skip to content
Snippets Groups Projects
Commit 1f53811b authored by Pavan B S's avatar Pavan B S Committed by mondrake
Browse files

Issue #2870355 by mondrake, Pavan B S: Removing deprecated entitymanager

parent 8741680b
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ class TextimageImageFieldFormatter extends ImageFormatter {
$configuration['view_mode'],
$configuration['third_party_settings'],
$container->get('current_user'),
$container->get('entity.manager')->getStorage('image_style'),
$container->get('entity_type.manager')->getStorage('image_style'),
$container->get('textimage.factory')
);
}
......
......@@ -110,7 +110,7 @@ class TextimageTextFieldFormatter extends FormatterBase implements ContainerFact
$configuration['third_party_settings'],
$container->get('current_user'),
$container->get('textimage.factory'),
$container->get('entity.manager')->getStorage('image_style'),
$container->get('entity_type.manager')->getStorage('image_style'),
$container->get('textimage.logger')
);
}
......
......@@ -4,7 +4,7 @@ namespace Drupal\textimage;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Session\AccountInterface;
......@@ -84,17 +84,17 @@ class TextimageFactory implements TextimageFactoryInterface {
* The current user.
* @param \Drupal\Core\StreamWrapper\StreamWrapperManager $stream_wrapper_manager
* The stream wrapper manager service.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The image style entity storage.
*/
public function __construct(ConfigFactoryInterface $config_factory, Token $token_service, LoggerInterface $logger, CacheBackendInterface $cache_service, AccountInterface $current_user, StreamWrapperManager $stream_wrapper_manager, EntityManagerInterface $entity_manager) {
public function __construct(ConfigFactoryInterface $config_factory, Token $token_service, LoggerInterface $logger, CacheBackendInterface $cache_service, AccountInterface $current_user, StreamWrapperManager $stream_wrapper_manager, EntityTypeManagerInterface $entity_type_manager) {
$this->configFactory = $config_factory;
$this->token = $token_service;
$this->logger = $logger;
$this->cache = $cache_service;
$this->currentUser = $current_user;
$this->streamWrapperManager = $stream_wrapper_manager;
$this->userStorage = $entity_manager->getStorage('user');
$this->userStorage = $entity_type_manager->getStorage('user');
}
/**
......
......@@ -11,3 +11,10 @@
function textimage_uninstall() {
\Drupal::service('textimage.factory')->flushAll();
}
/**
* Clear caches due to update of the 'textimage.factory' service.
*/
function textimage_update_8001() {
// Empty update to cause a cache rebuild.
}
......@@ -15,7 +15,7 @@ services:
arguments: ['textimage']
textimage.factory:
class: Drupal\textimage\TextimageFactory
arguments: ['@config.factory', '@token', '@textimage.logger', '@cache.textimage', '@current_user', '@stream_wrapper_manager', '@entity.manager']
arguments: ['@config.factory', '@token', '@textimage.logger', '@cache.textimage', '@current_user', '@stream_wrapper_manager', '@entity_type.manager']
textimage.logger:
class: Drupal\textimage\TextimageLogger
arguments: ['@config.factory', '@logger.channel.textimage', '@current_user']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment