Get users starred courses.

@param int $limit Limit
@param int $offset Offset

@return  array list of courses and warnings
971084
public static function get_starred_courses($limit, $offset) {
        global $USER, $PAGE;

        $params = self::validate_parameters(self::get_starred_courses_parameters(), [
            'limit' => $limit,
            'offset' => $offset
        ]);

        $limit = $params['limit'];
        $offset = $params['offset'];

        $usercontext = context_user::instance($USER->id);

        self::validate_context($usercontext);
        $PAGE->set_context($usercontext);
        $renderer = $PAGE->get_renderer('core');

        // Get the user favourites service, scoped to a single user (their favourites only).
        $userservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);

        // Get the favourites, by type, for the user.
        $favourites = $userservice->find_favourites_by_type('core_course', 'courses', $offset, $limit);

        // Sort the favourites getting last added first.
        usort($favourites, function($a, $b) {
            if ($a->timemodified == $b->timemodified) return 0;
            return ($a->timemodified > $b->timemodified) ? -1 : 1;
        });

        $formattedcourses = array_map(function($favourite) use ($renderer) {
            $course = get_course($favourite->itemid);
            $context = \context_course::instance($favourite->itemid);

            $exporter = new course_summary_exporter($course, ['context' => $context, 'isfavourite' => true]);
            return $exporter->export($renderer);
        }, $favourites);

        return $formattedcourses;
    }
654684
public function _getRecords($identifier, $limit, $offset) {
		return $this->Table
			->find()
			->where([$this->Table->alias() . '.model' => $identifier])
			->limit($limit)
			->offset($offset)
			->all();
	}
8271
public function getAllFriendships($limit = null, $offset = null): array
    {
        return $this->findFriendshipsByStatus(null, $limit, $offset);
    }
849795
public function get($code, $offset = 0, $limit = self::MAX_GET_USERS): array
    {
        $options = ['json' => [
            'code' => $code,
            'offset' => $offset,
            'size' => $limit
        ]];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->get(UserApi::generateUrl('organization/users.json'), $options)
            ->getBody();

        return $stream->jsonSerialize()['userTitles'];
    }
1197495
public function limit($limit, $offset = null)
    {
        $this->_limit = $limit > 0 ? (int)$limit : null;
        $this->_offset = $offset > 0 ? (int)$offset : null;

        return $this;
    }
416556
public function getChecks($limit = NULL, $offset = NULL) {
    $parameters = array();
    if (!empty($limit)) {
      $parameters['limit'] = $limit;
      if (!empty($offset)) {
        $parameters['offset'] = $offset;
      }
    }
    $data = $this->request('GET', 'checks', $parameters);
    return $data->checks;
  }
307404
public function loadAllGroups($offset = 0, $limit = -1)
    {
        $data = $this->objectStateGateway->loadObjectStateGroupListData($offset, $limit);

        return $this->objectStateMapper->createObjectStateGroupListFromData($data);
    }
749037
public function getMySqlData($limit, $offset)
    {

        try {
            $data = app('db')
                ->connection('mysql')
                ->select("select id as uid ,name,mobile,full_address,worker_lat,worker_lng,created_at,updated_at from " . config("database.mysql_workers") . " limit {$offset},{$limit}");
        } catch (\Exception $e) {
            Log::info('c=CopydataApiController f=getMySqlData  msg=' . $e->getMessage());
            return false;
        }
        return $data;
    }
587318
public function getAll($query, $limit, $offset)
    {
        // TODO: user query
        $users = $this->userManager->findBy(array(), array('lastname' => 'ASC'), $limit, $offset);

        $data = array();
        foreach ($users as $user) {
            $data[] = array(
                'securityType' => get_class($user),
                'securityId' => $user->getId(),
                'securityName' => $user->getDisplayName(),
            );
        }

        return array(
            'total' => $this->userManager->countAll(),
            'data' => $data,
        );
    }
115568
public function loadAllLocations($offset, $limit)
    {
        $this->logger->logCall(__METHOD__, array('offset' => $offset, 'limit' => $limit));

        return $this->persistenceHandler->locationHandler()->loadAllLocations($offset, $limit);
    }
1012141
public function getList($limit, $offset = 0)
    {
        return $this->getEntityManager()->createQuery('
            SELECT
                n
            FROM
                AnimeDbAppBundle:Notice n
            ORDER BY
                n.date_created DESC
        ')
            ->setFirstResult($offset)
            ->setMaxResults($limit)
            ->getResult();
    }
337962
public function getLists($offset = 0, $limit = 100)
	{
		$lists = [];
		foreach ($this->client->get("lists?offset={$offset}&limit={$limit}") as $list) {
			$lists[] = new Resources\MailingList($this, $list);
		}
		return $lists;
	}
1283490
public function getUserAgents($limit = 0)
    {
        $counter = 0;

        foreach ($this->loadFromPath() as $line) {
            if ($limit && $counter >= $limit) {
                return;
            }

            yield $line;
            ++$counter;
        }
    }
976753
public function getSubscriptions($limit = 100, $offset = 0)
    {
        /** @var SubscriptionFbApi $response */
        $response = $this->call(new Request('subscription.get', array(), $limit, $offset), 'DVelopment\FastBill\Model\SubscriptionFbApi');

        return $response->getResponse()->getSubscriptions();
    }
989677
public function slice($offset, $limit)
    {
        $attributes = array_slice($this->attributes, $offset, $limit);
        $list = new self();
        $list->assign($attributes);

        return $list;
    }
1147407
public function loadAllLocations($offset, $limit)
    {
        $rows = $this->locationGateway->loadAllLocationsData($offset, $limit);

        return $this->locationMapper->createLocationsFromRows($rows);
    }
248861
public function getFields($offset = 0, $limit = 100)
	{
		$fields = [];
		foreach ($this->client->get("fields?offset={$offset}&limit={$limit}") as $field) {
			$fields[] = new Resources\Field($this, $field);
		}
		return $fields;
	}