Add a getter for Entity\Query\QueryBase::$accessCheck

Created on 10 March 2025, 2 months ago

Problem/Motivation

Since πŸ“Œ Add an alter hook to EntityQuery RTBC it's been possible to alter an EntityQuery, however, there is no getter for the $accessCheck property so it's impossible use the hooks for access checking without using reflection β†’
.

Steps to reproduce

1. Implement one of the entity query alter hooks β†’ .
2. Try to determine if the query has accessCheck set to TRUE without using reflection.

Proposed resolution

Add a getter for accessCheck so that the property can be accessed without reflection.

The simplest way to do this would be to add asymmetric visibility, but since we support PHP 8.3 we'll need to define a new method.

Remaining tasks

  1. Write Patch

User interface changes

N/A

Introduced terminology

Since accessCheck is already taken, perhaps hasAccessCheck could work?

API changes

Adding a new method to Drupal\Core\Entity\Query\QueryInterface.

Data model changes

N/A

Release notes snippet

TBD

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡ΊπŸ‡ΈUnited States davidwbarratt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024