new act like objectmanager->create?
maybe its usefull that new acts like the objectmanager to make it easy to change objects by object.yaml?
this could be analyzed by looking for interface implementation for this object.
if it has, take a look in objects. yaml config for this interface config and initialized the defined
class. what do you think?
concret problem for me was, that i had to add a public function to the doctrine query object to get access
to the queryBuilder parameter. i had to add in objects.yaml a new persistencemanager and a new query object.
if i would have the upper functionality the new \TYPO3\FLOW3\Doctrine\PersistenceManager::createQueryForType() knows
about my new Query Object.
Updated by Karsten Dambekalns almost 10 years ago
- Status changed from New to Rejected
- Assignee set to Karsten Dambekalns
We cannot change the way PHP works, sorry.
new FooBar() will always give you an instance of
FooBar, no way around that.
You should use
$objectManager->get('FooBar') instead to achieve what you want.