/** * @param SS_HTTPRequest $req * @return bool|SS_HTTPResponse */ public function set_current_list(SS_HTTPRequest $req) { $list = WishList::get()->byID((int) $req->param('ID')); if (!$list || !$list->exists()) { $this->httpError(404); } if ($list->OwnerID != Member::currentUserID()) { $this->httpError(403); } $this->wishList = $list; WishList::set_current($list); $this->extend('updateSetCurrentListResponse', $req, $response, $list); return $response ? $response : $this->redirectBack(); }
/** * @param Member $member [optional] - defaults to current user * @return DataList */ public static function get_for_user(Member $member = null) { if (!$member) { $member = Member::currentUser(); } if (!$member) { return null; } return WishList::get()->filter('OwnerID', $member->ID); }