Hey Parsifal,

The hydrator knows different strategies. ByValue and ByReference.

The ByValue will use any getters/setters within your entity. The 
byReference will use the reflectionApi and will bypass any logic within 
your getter/setters in your entity.

So yes you can without creating getters and setters, so in that case you 
have the use the ByReference strategy, like so:

$hydrator = new DoctrineHydrator($objectManager, false);

The hydrator uses by default the ByValue strategy, setting the second argument 
to false will use the ByReference strategy.


See the following link within the documentation about the strategies:
https://github.com/doctrine/DoctrineModule/blob/master/docs/hydrator.md#by-value-and-by-reference


Op woensdag 29 juli 2015 10:01:17 UTC+2 schreef Parsifal:
>
> Thanks Kiwdo,
>
> I did read that manual and it seems entity class still needs to have 
> setter methods, setCity in this example, and hydrator just helps to avoid 
> calling lots of setter methods in controller and it assigns values to 
> respective setters.
> I don't think hydrator will work without actually having setter methods in 
> entities? Am I right?
>  

-- 
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 http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to