Get groups.

@param integer $limit Limit of the results count
@return array Request result
971117
public function getList($limit = 100)
    {
        $request = new Request('customizations');
        $request->setQuery(['limit' =>$limit]);

        $response = $this->client->get($request);

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
1075189
public function fetchAll($limit = null, $offset = null){
		$limit = $limit === null ? -1 : (int) $limit;
		if($offset !== null)
			$this->seek((int) $offset);

		$row = $this->fetch();
		if(!$row)
			return array();

		$rows = array();
		do{
			if($limit === 0)
				break;
			$rows[] = $row;
			$limit--;
		} while($row = $this->fetch());

		return $rows;
	}
466734
public function searchByName($name, $limit = 0)
    {
        if (!$name) {
            return [];
        }

        $selector = $this
            ->repository
            ->createQueryBuilder('i')
            ->innerJoin('i.names', 'n')
            ->where('LOWER(i.name) LIKE :name')
            ->orWhere('LOWER(n.name) LIKE :name')
            ->setParameter('name', preg_replace('/%+/', '%%', mb_strtolower($name, 'UTF-8')).'%')
            ->groupBy('i');

        if ($limit > 0) {
            $selector->setMaxResults($limit);
        }

        // get items
        return $selector
            ->getQuery()
            ->getResult();
    }
1325487
public function getJoinedGroupList($limit, $offset, $groupType = null, $responseFilter = null)
    {
        $request = new GetJoinedGroupListRequest($this->identifier, $limit, $offset, $groupType, $responseFilter);
        $response = new GetJoinedGroupListResponse();
        return $this->client->sendRequest($request, $response);
    }
962674
protected function getListLogOrder(array $limit)
    {
        $conditions = array(
            'limit' => $limit,
            'order_id' => $this->data_order['order_id']
        );

        return (array) $this->order_history->getList($conditions);
    }
1008750
public function getPageStatistics($limit = 20)
    {
        $db = Database::connection();
        $limitString = '';
        if ($limit != false) {
            $limitString = 'limit '.$limit;
        }

        if (is_object($this) && $this instanceof Page) {
            return $db->fetchAll("SELECT * FROM PageStatistics WHERE cID = ? ORDER BY timestamp desc {$limitString}", array($this->getCollectionID()));
        } else {
            return $db->fetchAll("SELECT * FROM PageStatistics ORDER BY timestamp desc {$limitString}");
        }
    }
1288893
public function getItems($offset, $limit) {
		$this->select->limit($limit, $offset);
		
		return $this->datagate->fetchAll($this->select);
	}
66904
public function games($limit = 100) : array
    {
        $returnGames = [];

        $games = $this->get(sprintf(Game::GAME_ENDPOINT . 'users/%s/titles', $this->onlineIdParameter()), [
            'type'  => 'played',
            'app'   => 'richProfile', // ??
            'sort'  => '-lastPlayedDate',
            'limit' => $limit,
            'iw'    => 240, // Size of game image width
            'ih'    => 240  // Size of game image height
        ]);

        if ($games->size === 0) return $returnGames;

        foreach ($games->titles as $game) {
            $returnGames[] = new Game($this->client, $game->titleId, $this);
        }

        return $returnGames;
    }
985985
public function getBestSellerProducts($limit = null)
    {
        $qb = $this->getItemQueryBuilder()
            ->select('p.id, p.name, COUNT(p.id) totalSellings')
            ->innerJoin('i.product', 'p')
            ->groupBy('p.id')
            ->orderBy('totalSellings', 'desc');

        if (!is_null($limit)) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()
            ->getSingleResult();
    }
330066
public function members(int $limit = 100) : array
    {
        $returnMembers = [];

        $members = $this->get(sprintf(self::COMMUNITY_ENDPOINT . 'communities/%s/members', $this->id()), [
            'limit' => $limit
        ]);

        if ($members->size === 0) return $returnMembers;

        foreach ($members->members as $member) {
            $returnMembers[] = new User($this->client, $member->onlineId);
        }

        return $returnMembers;
    }
985753
public function getItems($offset, $limit)
    {
        $this
            ->paginator
            ->getQuery()
            ->setFirstResult($offset)
            ->setMaxResults($limit)
        ;

        return iterator_to_array($this->paginator->getIterator());
    }
1217853
public function all($offset = 0, $limit = 15)
    {
        $results = array_slice($this->memory, $offset, $limit);

        foreach ($results as $key => $value) {
            $results[$key] = json_decode($value[self::SUMMARY_KEY]);
        }

        return $results;
    }
1347432
public function rangeLimit(int $max, int $limit) : array
        {
                $response =  $this->_redis->zrevrangebyscore($this->_key, $max, '-inf','WITHSCORES', 'LIMIT', 0, $limit);
                $result   = [];
                for($i=0,$num=count($response);$i<$num;$i++) {
                        $result[$response[$i]] = intval($response[++$i]);
                }
                return $result;
        }
738493
public function getAllDepartments($limit = CAKE_LDAP_SYNC_AD_LIMIT) {
		$fields = [
			$this->alias . '.id',
			$this->alias . '.value',
		];
		$blockExists = $this->hasField('block');
		if ($blockExists) {
			$fields[] = $this->alias . '.block';
		}
		$conditions = [];
		$order = [$this->alias . '.value' => 'asc'];
		$this->recursive = -1;

		return $this->find('all', compact('fields', 'conditions', 'order'));
	}
630554
public function getQueryResults($limit = null)
    {
        if (isset($limit)) {
            $this->queryBuilder->setMaxResults($limit);
        }
        
        if (!$this->queryBuilder->getDQLPart('orderBy')) {
            $this->queryBuilder->orderBy('a.createdAt', 'ASC');
        }

        return $this->queryBuilder->getQuery()->getResult();
    }
210994
public function getAllFolders($limit = null)
    {
        $qb = $this->createQueryBuilder('folder')->select('folder')->where('folder.parent is null AND folder.deleted != true')->orderby('folder.name');
        if (false === is_null($limit)) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()->getResult();
    }
1189324
public function tweets($limit = 1000)
    { 
        $params = [
            'index' => $this->_esindex,
            'type' => $this->_estype,
            'size' => $limit,
            'body' => [
                'query' => [
                    'match_all' => []
                ]
            ]
        ];
        $query = $this->_es->search($params);
        if ($query['hits']['total'] >= 1)
            $result = $query['hits']['hits'];
        else
            $result = [];
        return $result;
    }