Get boards invites
@return array
973572
public function invites()
    {
        $data = [
            'current_user'  => true,
            'field_set_key' => 'news',
        ];

        $invites = $this->get(UrlBuilder::RESOURCE_BOARDS_INVITES, $data);

        return !$invites ? [] : $invites;
    }
322132
public function index()
    {
        $invitations = MemberInvitation::with(
            'member',
            'member.user',
            'inviter',
            'inviter.user'
        )
            ->active()
            ->forUserContext($this->userContext())
            ->orderBy('created_at', 'desc')
            ->paginate(config('app.pagination_default'));
        return fractal($invitations, new MemberInvitationTransformer())
            ->withResourceName('memberInvitation')
            ->respond();
    }
138764
protected function getItemsFromDatabase()
    {
        $brandId = $this->repository->make('antares.memory')->make('primary')->get('brand.default');
        if (auth()->guest()) {
            return [];
        }
        $roleId = auth()->user()->roles->first()->id;
        $items  = $this->resolver()->where(['brand_id' => $brandId, 'role_id' => $roleId])->get();
        $return = [];

        foreach ($items as $item) {
            $form       = $item->form;
            $attributes = array_merge($item->getAttributes(), ['action_id' => $form->action_id, 'name' => $form->name]);
            array_push($return, $attributes);
        }
        return $return;
    }
746158
public function getAppliedSets()
	{
		$list = ArrayList::create();
		if (!$this->owner->InheritBlockSets) {
			return $list;
		}

		$sets = BlockSet::get()->where("(PageTypesValue IS NULL) OR (PageTypesValue LIKE '%:\"{$this->owner->ClassName}%')");
		$ancestors = $this->owner->getAncestors()->column('ID');

		foreach ($sets as $set) {
			$restrictedToParerentIDs = $set->PageParents()->column('ID');
			if (count($restrictedToParerentIDs)) {
				// check whether the set should include selected parent, in which case check whether
				// it was in the restricted parents list. If it's not, or if include parentpage
				// wasn't selected, we check the ancestors of this page.
				if ($set->IncludePageParent && in_array($this->owner->ID, $restrictedToParerentIDs)) {
					$list->add($set);
				} else {
					if (count($ancestors)) {
						foreach ($ancestors as $ancestor) {
							if (in_array($ancestor, $restrictedToParerentIDs)) {
								$list->add($set);
								continue;
							}
						}
					}
				}
			} else {
				$list->add($set);
			}
		}

		return $list;
	}
835268
public function rules()
    {

        $allowed_registration = implode(',', Seat::$options['registration']);
        $allowed_cleanup = implode(',', Seat::$options['cleanup_data']);
        $allowed_tracking = implode(',', Seat::$options['allow_tracking']);

        return [
            'registration'   => 'required|in:' . $allowed_registration,
            'cleanup_data'   => 'required|in:' . $allowed_cleanup,
            'admin_contact'  => 'required|email',
            'allow_tracking' => 'required|in:' . $allowed_tracking,
        ];
    }
1078385
protected function getParticipants() {
        if (!$this->_participants) {
            $this->_participants = new ParticipantList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_participants;
    }
784548
public function getBetterButtonsActions()
    {
        /** @var FieldList $fields */
        $fields = parent::getBetterButtonsActions();
        if ($this->TicketFile()->exists() && !empty($this->getEmail())) {
            $fields->push(BetterButtonCustomAction::create('sendTicket', _t('Attendee.SEND', 'Send the ticket')));
        }

        if (!empty($this->getName()) && !empty($this->getEmail())) {
            $fields->push(BetterButtonCustomAction::create('createTicketFile', _t('Attendee.CREATE_TICKET', 'Create the ticket')));
        }

        return $fields;
    }
823579
public function getPostFindActions()
    {
        $actions = [];

        empty($this->orderBy) || $actions[] = ['sort', $this->orderBy];
        $this->skip === null || $actions[] = ['skip', $this->skip];
        $this->limit === null || $actions[] = ['limit', $this->limit];

        return $actions;
    }
1059008
protected function getNewPosts()
    {
        Container::get('hooks')->fire('model.index.get_new_posts_start');

        $query['select'] = ['f.id', 'f.last_post'];
        $query['where'] = [
            ['fp.read_forum' => 'IS NULL'],
            ['fp.read_forum' => '1']
        ];
        $query = DB::forTable('forums')
            ->table_alias('f')
            ->select_many($query['select'])
            ->left_outer_join(
                DB::prefix().'forum_perms',
                '(`fp`.`forum_id`=`f`.`id` AND `fp`.`group_id`='.User::get()->g_id.')',
                'fp'
            )
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.forum_id', '=', 'f.id'), 'fp')
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.group_id', '=',
// User::get()->g_id), null, true)
//            ->where_any_is($query['where'])
            ->where_raw('(fp.read_forum IS NULL OR fp.read_forum = 1)')
            ->where_gt('f.last_post', User::get()->last_visit);

        $query = Container::get('hooks')->fireDB('model.index.query_get_new_posts', $query);

        $query = $query->find_result_set();

        $forums = $new_topics = [];
        $tracked_topics = Track::getTrackedTopics();

        foreach ($query as $cur_forum) {
            if (!isset($tracked_topics['forums'][$cur_forum->id]) ||
                $tracked_topics['forums'][$cur_forum->id] < $cur_forum->last_post) {
                $forums[$cur_forum->id] = $cur_forum->last_post;
            }
        }

        if (!empty($forums)) {
            if (empty($tracked_topics['topics'])) {
                $new_topics = $forums;
            } else {
                $query['select'] = ['forum_id', 'id', 'last_post'];

                $query = DB::forTable('topics')
                    ->select_many($query['select'])
                    ->where_in('forum_id', array_keys($forums))
                    ->where_gt('last_post', User::get()->last_visit)
                    ->where_null('moved_to');

                $query = Container::get('hooks')->fireDB('model.index.get_new_posts_query', $query);

                $query = $query->find_result_set();

                foreach ($query as $cur_topic) {
                    if (!isset($new_topics[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['forums'][$cur_topic->forum_id]) ||
                            $tracked_topics['forums'][$cur_topic->forum_id] < $forums[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['topics'][$cur_topic->id]) ||
                            $tracked_topics['topics'][$cur_topic->id] < $cur_topic->last_post)) {
                        $new_topics[$cur_topic->forum_id] = $forums[$cur_topic->forum_id];
                    }
                }
            }
        }

        $new_topics = Container::get('hooks')->fire('model.index.get_new_posts', $new_topics);

        return $new_topics;
    }
655987
public function actionDashboardLog()
    {
        $data = Log::find()->orderBy(['timestamp' => SORT_DESC])->with(['user'])->limit(60)->all();
        $log= [];
        foreach ($data as $item) {
            $log[strtotime('today', $item->timestamp)][] = $item;
        }
        
        $array = [];
        
        krsort($log, SORT_NUMERIC);
        
        foreach ($log as $day => $values) {
            $array[] = [
                'day' => $day,
                'items' => $values,
            ];
        }
        
        return $array;
    }
331168
public function getDashboardNavigationGroups()
    {
        $groups = $this->getDashboardGroups();

        $menuGroups = $this->getContainer()->getParameter('networking_init_cms.admin_menu_groups');

        foreach ($menuGroups as $key => $menuGroup) {
            foreach ($menuGroup['items'] as $k => $item) {
                if (array_key_exists($item, $groups)) {
                    $menuGroups[$key]['sub_group'][$k] = $groups[$item];
                }
            }
        }

        return $menuGroups;
    }
1373224
public function getNavs()
    {
        return $this->hasMany(Nav::className(), ['nav_container_id' => 'id'])->where(['is_deleted' => false, 'is_draft' => false])->orderBy(['sort_index' => SORT_ASC]);
    }
1020507
protected function getConferences() {
        if (!$this->_conferences) {
            $this->_conferences = new ConferenceList($this->version, $this->solution['sid']);
        }

        return $this->_conferences;
    }
959106
public function getAssignedMembers()
    {
        $list   = new ArrayList();
        $groups = $this->Groups();

        $list->merge($this->Users());

        foreach ($groups as $group) {
            $list->merge($group->Members());
        }

        $list->removeDuplicates();
        return $list;
    }
101731
public function getBins()
    {
        if (!isset($this->package['bin'])) {
            return array();
        }

        $bins = array();
        foreach ($this->package['bin'] as $bin) {
            $bins []= $this->getAbsolutePath($bin);
        }

        return $bins;
    }
649762
public static function get_tours() {
        global $DB;

        $tours = $DB->get_records('tool_usertours_tours', array(), 'sortorder ASC');
        $return = [];
        foreach ($tours as $tour) {
            $return[$tour->id] = tour::load_from_record($tour);
        }
        return $return;
    }
1184196
protected function getPagesBlog()
    {
        $conditions = $this->query_filter;

        $conditions['status'] = 1;
        $conditions['blog_post'] = 1;
        $conditions['limit'] = $this->data_limit;
        $conditions['store_id'] = $this->store_id;

        $list = (array) $this->page->getList($conditions);
        $this->preparePagesBlog($list);
        return $list;
    }