Hey Fabricio,

In doctrine, your entities should be as unaware of the DB as possible.
This is not always achievable, but your entities should not care about the
DB where they are saved.
What you are looking for is the ActiveRecord approach, which is usually
un-suited for complex business domain logic encapsulation.
It is un-suited mostly because the coupling with the DB layer makes it
really hard to design the object so that it still follow your business
logic, as you end up designing more and more against persistence concerns
instead.

Cheers,

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 23 June 2016 at 00:23, 'Fabricio Soares' via doctrine-user <
[email protected]> wrote:

> Why the Doctrine implements persistence with the Entity Manager instead of
> a save method in the entity?
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to