This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Entity getter in different situation

New topics about Symfony 2 should go here

Entity getter in different situation

by ghasrfakhri » Mon Jun 22, 2015 2:31 pm

Hi,
I have a Symfony2/AngularJS application and using FOSRestBundle with JMS Serializer Bundle. For normal entities every thing works great but in one of my entities that contains a collection of messages (fro example a topic entity) I need to return subset of messages in different situations.
For example for the Topic Entity Owner I want to return all messages of the topic for message owner I want to return just the message that posts with the message owner and for other users I don't want to return any messages but they can post a message on topic.

I'm not sure where to implement this. In the topic entity or in the controller or ...

There is a filtering a feature in doctrine but I'm not sure where to use if, In entity or Model/Controller
http://doctrine-orm.readthedocs.org/en/ ... ollections
ghasrfakhri
Junior Member
 
Posts: 1
Joined: Mon Jun 22, 2015 2:23 pm