Skip to content
Advertisement

Programmatically load Entity in symfony

I am trying to load in Entity classes and use within a loop in order to load content in dynamically from files into relating tables.

Is there any way i can load in all Entity files from the following

JavaScript

in such a way like this?

JavaScript

Not sure if this is possible in Symfony.

My next issue is using the the prefixedEntity within a loop like so –

JavaScript

When i am setting $entityPrefix to the following format

JavaScript

which returns the string of

JavaScript

can anyone advise as to why calling

JavaScript

is not working

Thanks in advance for any help!

trying to call

JavaScript

returns

JavaScript

even when i current am hrd coding the use stament to call

JavaScript

Advertisement

Answer

I solved this by pulling out the functionality into a helper and running a switch statement based on the input – in this case a {prefix}

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement