More complex setup of service
- mkoubik
- Member | 728
How do I call chain of methods in service's setup
? I use it
for doctrine's connection.
This:
services:
doctrine.conenction:
create: ...
setup:
- getDatabasePlatform()->registerDoctrinetypeMapping(enum, string)
doesn't work.
And this:
services:
doctrine.connection:
create: ...
setup:
- @doctrine.platform::registerDoctrinetypeMapping(enum, string)
doctrine.platform:
create: @doctrine.connection::getDatabasePlatform()
(obviously) complains about circular reference.
- Filip Procházka
- Moderator | 4668
Or you could just use kdyby/doctrine ;)
doctrine:
types:
myType: My\Cool\Type
Theese complicated setups are better done in compiler extensions.
Last edited by Filip Procházka (2013-09-17 00:42)
- mkoubik
- Member | 728
Yeah, but kdyby/doctrine is full of stuff i don't need.
Also I don't like using extensions for things that don't need to be integrated to nette (I use kdyby/console though). All I need is to get the entity manager to DI container, everything else is job for my domain/persistence logic.
Last edited by mkoubik (2013-09-17 22:23)
- Filip Procházka
- Moderator | 4668
mkoubik wrote:
include one neon config (seems more clear to me than extension)
Well, it's not :) And you're spending preciouse hours on something that has been already done and it's much better already, because shitload of people is using it and reporting stuff.
Yeah, but kdyby/doctrine is full of stuff i don't need.
<OT>You may think that, but you're wrong :) I'm gonna interrogate you at some posobota :P</OT>
Last edited by Filip Procházka (2013-09-18 13:43)
- mkoubik
- Member | 728
It's because doctrine is full of stuff I don't need (but also full of stuf that I desperately need and that are not included in no existing php orm). Kdyby/Doctrine is great for builduing anemic CRUD model, but full of antipatterns from DDD's point of view. Looking forward to discussing it.