In my code I currently have an active record implementation of a Staff
object. Namely, that object self-populates at creation time, and
self-reloads when required.
class Staff
{
private $id;
private $name;
private $email;
//all the getters and setters
}
I changed the code where I pulled out database code out of it to where it
now populates from the outside. One of the next steps I can take is make
this object into a Doctrine Entity, which is a fairly-well understood
concept to me (I have existing entities in my code)
Before going that route, I thought .. what if I make it into an immutable
value object. Will it benefit me?
And that is my question here. Staff is used as part of a session and
typically does not need to be mutable.
As part of making it a value object I can *remove all the setters* and *move
all initialization and object-loading code into the constructor*.
This is where I'm struggling ... If I do this
- can I still use the object with Doctrine?
- Is doing this a good idea?
--
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.