It's very hard to do that with each entity in each DQL query.
For example, Laravel framework has such mechanizm out-of-the-box:
class User extends Eloquent {
protected $hidden = array('password');
}
Doctrine 2 uses Annotations to describe all model metadata. So, it will be
good if annotation tag like '@Hidden' will be supported.
So, may be exists some way to support custom annotation for model and
implement 'filter hidden fields' logic based on it?
вторник, 9 декабря 2014 г., 14:52:11 UTC+3 пользователь Jàπ (Jasper N.
Brouwer) написал:
>
> Doctrine doesn't support something like a @Hidden annotation.
>
> You'll need to manually select the properties you want to hydrate. So in
> stead of:
>
> SELECT u FROM User u
>
> You do:
>
> SELECT u.id, u.name FROM User u
>
> --
> Jasper N. Brouwer
> (@jaspernbrouwer)
>
>
> On 9 December 2014 at 12:42:27, Pavel Sokolov ([email protected]
> <javascript:>) wrote:
> > Yes, I mean not to get property when executing query.
> > It is very hard to manually unset it from returned array because I'm
> using
> > complicated queries with many joins and returned array has many nested
> > arrays inside.
> > It will be better to add annotation like '@Hidden' to Model class.
>
>
>
--
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.