Reputation: 691
By default the 'index' action in my EventsController (or any Controller) returns the full set of entries and I want to display only the events created by the currently logged in user (the associations are well defined and my events table has a foreign key user_id
).
here is the default index action as generated from the cake bake console command:
class EventsController extends AppController {
public function index() {
$this->Event->recursive = 0;
$this->set('events', $this->paginate());
}
....
}
There might be something with the $this->paginate()
that I don't understand, 'cause already I tried to retrieve the entries I need using $events = $this->find('all',$options)
and it didn't do anything. Is there a way to specify my conditions as to which entries will be returned to the view?
Upvotes: 0
Views: 129