Doctrine 'ORM\Cache' with inherited classes #7026

Open
opened 2026-01-22 15:43:21 +01:00 by admin · 1 comment
Owner

Originally created by @meiyasan on GitHub (Aug 18, 2022).

Hello,

I have two entities inheriting from one to each other named "Tag" and "Channel"
Channel extends from Tag, and I configured Channel to be cached using a NonStrictReadWriteCachedEntityPersister
@ORM\Cache(usage="NONSTRICT_READ_WRITE")

At first I forgot to use "NONSTRICT_READ_WRITE" in Tag as well.
This resulted in an error message:
Attempted to call an undefined method named "getCacheRegion" of class "Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister".

I think this was just due to the fact that there is no interface for CachedEntityPersisters.
I am not a doctrine expert, but I don't think this is a huge issue to fix.

Originally created by @meiyasan on GitHub (Aug 18, 2022). Hello, I have two entities inheriting from one to each other named "Tag" and "Channel" Channel extends from Tag, and I configured Channel to be cached using a NonStrictReadWriteCachedEntityPersister ``` @ORM\Cache(usage="NONSTRICT_READ_WRITE") ``` At first I forgot to use "NONSTRICT_READ_WRITE" in Tag as well. This resulted in an error message: ```Attempted to call an undefined method named "getCacheRegion" of class "Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister".``` I think this was just due to the fact that there is no interface for CachedEntityPersisters. I am not a doctrine expert, but I don't think this is a huge issue to fix.
Author
Owner

@meiyasan commented on GitHub (Aug 18, 2022):

Just an attempt to fix. This solved the ambiguity.
#10000 🤩

@meiyasan commented on GitHub (Aug 18, 2022): Just an attempt to fix. This solved the ambiguity. #10000 🤩
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7026