Closed
Description
I'm currently working on a project where I'm dealing with abstract inputs and facing some challenges with annotation. I have an entity, let's call it AbstractUser, and several types of users inheriting from it, such as RegularUser and Employee. Additionally, there's another entity named Business, which can be owned by either a RegularUser or an Employee.
In my code, I have a method setUser(AbstractUser $user) which should accept an AbstractUser as a parameter. However, I encountered an issue where using AbstractUser as an input parameter isn't feasible because it's not a final class and cannot be instantiated. In my case it's Doctrine inheritance and annotated entities.
What is the right path in that case?
Metadata
Metadata
Assignees
Labels
No labels