X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fserialization%2Fsrc%2FEntityResolver%2FUuidResolver.php;fp=web%2Fcore%2Fmodules%2Fserialization%2Fsrc%2FEntityResolver%2FUuidResolver.php;h=561b4f7fdbd873f78b1f969435dc65f9e6f1fb21;hp=4a3b0a20591d3bc69f3a4a1b10134445e404ead3;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/serialization/src/EntityResolver/UuidResolver.php b/web/core/modules/serialization/src/EntityResolver/UuidResolver.php index 4a3b0a205..561b4f7fd 100644 --- a/web/core/modules/serialization/src/EntityResolver/UuidResolver.php +++ b/web/core/modules/serialization/src/EntityResolver/UuidResolver.php @@ -2,7 +2,7 @@ namespace Drupal\serialization\EntityResolver; -use Drupal\Core\Entity\EntityManagerInterface; +use Drupal\Core\Entity\EntityRepositoryInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; /** @@ -11,20 +11,20 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class UuidResolver implements EntityResolverInterface { /** - * The entity manager. + * The entity repository. * - * @var \Drupal\Core\Entity\EntityManagerInterface + * @var \Drupal\Core\Entity\EntityRepositoryInterface */ - protected $entityManager; + protected $entityRepository; /** * Constructs a UuidResolver object. * - * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager - * The entity manager. + * @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository + * The entity repository. */ - public function __construct(EntityManagerInterface $entity_manager) { - $this->entityManager = $entity_manager; + public function __construct(EntityRepositoryInterface $entity_repository) { + $this->entityRepository = $entity_repository; } /** @@ -35,7 +35,7 @@ class UuidResolver implements EntityResolverInterface { // deserialized. If it can return a UUID from that data, and if there's an // entity with that UUID, then return its ID. if (($normalizer instanceof UuidReferenceInterface) && ($uuid = $normalizer->getUuid($data))) { - if ($entity = $this->entityManager->loadEntityByUuid($entity_type, $uuid)) { + if ($entity = $this->entityRepository->loadEntityByUuid($entity_type, $uuid)) { return $entity->id(); } }