Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Module filter at backend


Reply


2 Posts   292 Views

Avatar
khanhdeux

Community Member, 13 Posts

10 December 2013 at 10:03pm

Hi Silverstripe team

I have a module called Video, but at the backend i wanna display list of video which belong to the current user and modify the search function with only videos the that user uploaded? really appreciate any help? Thanks

Avatar
Willr

Forum Moderator, 5513 Posts

11 December 2013 at 8:52pm

You should post some more details about your situation. If you have a has_one relation between video and users (where Video has one 'User' you can get a users videos by using

Video::get()->filter('UserID', Member::currentUserID());

The search query would need to filter by that same 'UserID' field on your Video model.