1414use Drupal \Core \Entity \EntityTypeBundleInfoInterface ;
1515use Drupal \Core \Entity \EntityTypeInterface ;
1616use Drupal \Core \Field \FieldDefinitionInterface ;
17- use Drupal \Core \KeyValueStore \KeyValueFactoryInterface ;
18- use Drupal \Core \KeyValueStore \KeyValueStoreInterface ;
1917use Drupal \pantheon_content_publisher \Entity \PantheonDocument ;
2018use Symfony \Component \DependencyInjection \ContainerInterface ;
2119
@@ -26,8 +24,6 @@ class PantheonDocumentStorage extends ContentEntityStorageBase implements Panthe
2624
2725 const SEPARATOR = '. ' ;
2826
29- protected KeyValueStoreInterface $ seenStore ;
30-
3127 public function __construct (
3228 EntityTypeInterface $ entity_type ,
3329 EntityFieldManagerInterface $ entity_field_manager ,
@@ -36,9 +32,7 @@ public function __construct(
3632 EntityTypeBundleInfoInterface $ entity_type_bundle_info ,
3733 protected EntityStorageInterface $ collectionStorage ,
3834 protected PantheonContentPublisherConverter $ pantheonContentPublisherConverter ,
39- KeyValueFactoryInterface $ keyValueFactory ,
4035 ) {
41- $ this ->seenStore = $ keyValueFactory ->get ('pantheon_document.seen ' );
4236 parent ::__construct ($ entity_type , $ entity_field_manager , $ cache , $ memory_cache , $ entity_type_bundle_info );
4337 }
4438
@@ -50,8 +44,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
5044 $ container ->get ('entity.memory_cache ' ),
5145 $ container ->get ('entity_type.bundle.info ' ),
5246 $ container ->get ('entity_type.manager ' )->getStorage ('pantheon_document_collection ' ),
53- $ container ->get ('pantheon_content_publisher.converter ' ),
54- $ container ->get ('keyvalue ' )
47+ $ container ->get ('pantheon_content_publisher.converter ' )
5548 );
5649 }
5750
@@ -71,9 +64,6 @@ protected function doLoadMultiple(?array $ids = NULL) {
7164 $ drupal_data = $ this ->pantheonContentPublisherConverter
7265 ->convert ($ pantheon_data , $ collection_name , $ id );
7366 $ document = PantheonDocument::create ($ drupal_data );
74- if ($ this ->seenStore ->setIfNotExists ($ id , 1 )) {
75- $ this ->invokeHook ('insert ' , $ document );
76- }
7767 $ entities [$ id ] = $ document ->enforceIsNew (FALSE );
7868 }
7969 return $ entities ;
@@ -137,11 +127,4 @@ public static function getEntityId(string|PantheonDocumentCollectionInterface $c
137127 $ pantheon_id ;
138128 }
139129
140- protected function doDelete ($ entities ) {
141- parent ::doDelete ($ entities );
142- foreach ($ entities as $ entity ) {
143- $ this ->seenStore ->delete ($ entity ->id ());
144- }
145- }
146-
147130}
0 commit comments