X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpermissions_by_term%2Fmodules%2Fpermissions_by_entity%2Fsrc%2FService%2FCheckedEntityCache.php;fp=web%2Fmodules%2Fcontrib%2Fpermissions_by_term%2Fmodules%2Fpermissions_by_entity%2Fsrc%2FService%2FCheckedEntityCache.php;h=5e4a93ec6899b7a277074814f0ece35a96e7f4c7;hp=edda07b5460953b11d1bac09bee5739d08a788c1;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/permissions_by_term/modules/permissions_by_entity/src/Service/CheckedEntityCache.php b/web/modules/contrib/permissions_by_term/modules/permissions_by_entity/src/Service/CheckedEntityCache.php index edda07b54..5e4a93ec6 100644 --- a/web/modules/contrib/permissions_by_term/modules/permissions_by_entity/src/Service/CheckedEntityCache.php +++ b/web/modules/contrib/permissions_by_term/modules/permissions_by_entity/src/Service/CheckedEntityCache.php @@ -2,7 +2,7 @@ namespace Drupal\permissions_by_entity\Service; -use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\FieldableEntityInterface; /** * Class CheckedEntityCache. @@ -14,32 +14,32 @@ class CheckedEntityCache { /** * The checked entities. * - * @var \Drupal\Core\Entity\ContentEntityInterface[] + * @var \Drupal\Core\Entity\FieldableEntityInterface[] */ private $entities = []; /** * Returns if an entity has already been checked. * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The content entity. + * @param \Drupal\Core\Entity\FieldableEntityInterface $entity + * A fieldable entity. * * @return bool * Returns TRUE if the entity has already been checked, otherwise FALSE. */ - public function isChecked(ContentEntityInterface $entity) { + public function isChecked(FieldableEntityInterface $entity) { return in_array($entity, $this->entities, TRUE); } /** - * Adds a content entity to the cache. + * Adds a fieldable entity to the cache. * * If the entity has already been added to the cache, nothing will be done. * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The content entity. + * @param \Drupal\Core\Entity\FieldableEntityInterface $entity + * A fieldable entity. */ - public function add(ContentEntityInterface $entity) { + public function add(FieldableEntityInterface $entity) { // In order to avoid duplicate entries we check if the entity is already in // the list of entities. if (!$this->isChecked($entity)) { @@ -50,7 +50,7 @@ class CheckedEntityCache { /** * Clears the cache. * - * All cached content entities will be removed irretrievably from the cache. + * All cached fieldable entities will be removed irretrievably from the cache. */ public function clear() { $this->entities = [];