I had a need to add ACL rules to entities at the repository level.
My biggest struggle was getting dependancy injection working.
This is what I finally came up with after a fresh mind and an instant coffee:
Mini rants, mostly about Linux admin and PHP code
I had a need to add ACL rules to entities at the repository level.
My biggest struggle was getting dependancy injection working.
This is what I finally came up with after a fresh mind and an instant coffee:
If your EntityRepository needs to know about the DIC, you made it wrong…
Mmm nice trick.
I do get the idea of separation, however suppose I have a helper class with a lof of common string manipulations I have to do from and to the database in every entityRepository.
Pulling it out of the Container sounds a lot cleaner than duplicate the code?
Anyone have a proper idea how this would be handled correctly?
Thanks!
Why would you not want to use a trait to implement the string manipulation functions? Then each class that needs those functions can use the trait.