S
S
symnoob2021-08-31 19:28:24
symfony
symnoob, 2021-08-31 19:28:24

How to get to service from Entity?

Hello everyone,

how can I get to the Service in the Entity, while in the Entity method static?

I know it's terrible, but that's exactly what I'm supposed to do.. :-(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Kalachev, 2021-09-09
@ksn135

Well po#%nokodim!! )
Make a static property in the entity, push the necessary service or even a container there through the setter.
PLEASE DON'T REPEAT THIS, THIS IS BAD CODE, THE TRICKS ARE PERFORMED BY SPECIALLY TRAINED PEOPLE!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question