2009/9/11 Benjamin Eberlei <kont...@beberlei.de>:
>
> The createEntity() method in the loader is pretty much internal,
> what exactly do you want to inject into a specific entity? You
> can overwrite the Mapper however, which instantiates the loaders
> and overwrite the method in entity loader.

I was thinking of injecting supporting classes, for example an entity
may need to use a service, say for emailing. It would then be better
to inject the EmailService into the entity?

>
> The Aggregate metadata map has the disadvantage that you either
> specify dependencies between different modules or you don't. In
> either way you do or don't couple the modules which would speak
> for specifying them in either one metadata map, or use two
> different entity managers.

Seems reasonable, I was just looking at how you would organize the
various metadata files between modules, but having multiple managers
makes sense.

>
> greetings,
> Benjamin
>
> On Fri, 11 Sep 2009 14:25:49 +0100, keith Pope <mute.p...@googlemail.com>
> wrote:
>> Hi,
>>
>> I am just having a look at Zend_Entity, I was wondering how it handles
>> object/entity instantiation, having a look through the code the
>> Zend_Db_Mapper_Loader_LoaderAbstract has a createEntity() method which
>> instantiates the entity. Is it planned that we will be able to
>> override this and provide custom instantiation code/loaders for the
>> entity manager? I am coming from the angle that it would be nice to be
>> able to inject a DI container into the manager, maybe I am thinking
>> about it wrong?
>>
>> Other than that the docs were really good and I was able to get
>> everything working very quickly, good work :)
>>
>> Thx
>>
>> Keith
>



-- 
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

Reply via email to