There is a shortcut method to create an object from a method that return a string?
For the moment, I used that :
class MyClass {
/**
* @return string
*/
public function getEntityName() {
return 'myEntityName';
}
}
$myClassInstance = new MyClass();
// Need to get string
$entityName = $myclassInstance->getEntityName();
// And after I can instantiate it
$entity = new $entityName();