DependencyTagResolver
in package
Derives cross-entity dependencies of a cached graph as a list of tags (entity FQCNs) for {@see TagVersions}.
The tags are the root entity plus the classes reached by walking Doctrine association metadata along:
- include paths (the payload carries nested entities),
- dotted paths of filters (the query joins through relations),
- dotted paths of order-bys (ordering through relations).
Example: an Advert list with categoryRels.category.translations carries the tags Advert,
AdvertCategoryRel, Category and CategoryText, so saving a Category invalidates it immediately.
Memoized per root and path set because the metadata is immutable at runtime.
Table of Contents
Properties
Methods
- __construct() : mixed
- resolve() : array<string|int, string>
- resolveForQuery() : array<string|int, string>
- canonicalName() : class-string|null
- classesAlongPath() : array<string|int, string>
- Walks a dotted path through associations. A scalar segment or an unknown path ends the walk, because no associations follow.
- filterPaths() : array<string|int, string>
- Returns the dotted paths from the filter tree (recursively through `GroupFilter`).
Properties
$em read-only
private
EntityManagerInterface
$em
$memo
private
array<string, array<string|int, string>>
$memo
= []
signature to tags
Methods
__construct()
public
__construct(EntityManagerInterface $em) : mixed
Parameters
- $em : EntityManagerInterface
resolve()
public
resolve(class-string $rootClass, array<string|int, string> $paths) : array<string|int, string>
Parameters
- $rootClass : class-string
- $paths : array<string|int, string>
Return values
array<string|int, string>resolveForQuery()
public
resolveForQuery(class-string $rootClass, string|array<int, mixed> $includes, array<int, mixed> $filters, array<string, mixed>|null $orderBys) : array<string|int, string>
Parameters
- $rootClass : class-string
- $includes : string|array<int, mixed>
-
dotted relation paths
- $filters : array<int, mixed>
-
rebuilt filter objects (
getFields()returns dotted paths) - $orderBys : array<string, mixed>|null
-
key is the dotted order path
Return values
array<string|int, string> —unique list of tags (entity FQCNs)
canonicalName()
private
canonicalName(class-string $class) : class-string|null
Parameters
- $class : class-string
Return values
class-string|nullclassesAlongPath()
Walks a dotted path through associations. A scalar segment or an unknown path ends the walk, because no associations follow.
private
classesAlongPath(class-string $rootClass, string $path) : array<string|int, string>
Parameters
- $rootClass : class-string
- $path : string
Return values
array<string|int, string> —target entity FQCNs along the path
filterPaths()
Returns the dotted paths from the filter tree (recursively through `GroupFilter`).
private
filterPaths(array<int, mixed> $filters) : array<string|int, string>
Parameters
- $filters : array<int, mixed>