1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: 16: 17:
18: class ClipitEvent extends UBEvent {
19: static function get_recommended_events($user_id, $offset = 0, $limit = 10) {
20: $user_groups = ClipitUser::get_groups($user_id);
21: $user_activities = ClipitUser::get_activities($user_id);
22: $user_tasks = array();
23: foreach($user_activities as $activity_id){
24: $user_tasks = array_merge($user_tasks, ClipitActivity::get_tasks($activity_id));
25: }
26: $object_array = array_merge($user_groups, $user_activities, $user_tasks);
27: return static::get_by_object($object_array, $offset, $limit);
28: }
29:
30: static function get_all_events($offset = 0, $limit = 10){
31: $all_groups = ClipitGroup::get_all(0, 0, "", true, true);
32: $all_activities = ClipitActivity::get_all(0, 0, "", true, true);
33: $all_tasks = ClipitTask::get_all(0, 0, "", true, true);
34: $all_objects = array_merge($all_groups, $all_activities, $all_tasks);
35: return static::get_by_object($all_objects, $offset, $limit);
36: }
37: }