/*
Get all fields that are set for a subscriber.
@param integer $subscriber
@param integer $offset
@param integer $limit
@return \Iconneqt\Api\Rest\Resources\SubscriberField[]
543822
public function getSubscriberFields($subscriber, $offset = 0, $limit = 100)
	{
		$fields = [];
		foreach ($this->client->get("subscribers/{$subscriber}/fields?offset={$offset}&limit={$limit}") as $subscriber) {
			$fields[] = new Resources\SubscriberField($this, $subscriber);
		}
		return $fields;
	}
1288893
public function getItems($offset, $limit) {
		$this->select->limit($limit, $offset);
		
		return $this->datagate->fetchAll($this->select);
	}
791159
public function limit($limit = null, $offset = null)
    {
        $this->results = $this->fetch($limit, $offset);

        return $this->results->fetchAll();
    }
219918
public function limit($limit, $offset = null)
    {
        if ($offset !== null) {
            $this->builder->setFirstResult((int) $offset);
        }

        $this->builder->setMaxResults((int) $limit);

        return $this;
    }
578108
public function getEventSubscriber($subscriber, $config = array())
    {
        if (! ($subscriber instanceof AnServiceIdentifier)) {
            //Create the complete identifier if a partial identifier was passed
            if (is_string($subscriber) && strpos($subscriber, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('event', 'handler');
                $identifier->name = $subscriber;
            } else {
                $identifier = $this->getIdentifier($subscriber);
            }
        }
    
        if (! isset($this->_event_subscribers[(string) $identifier])) {
            $config['event_dispatcher'] = $this->getEventDispatcher();
            $subscriber = $this->getService($identifier, $config);
             
            //Check the event subscriber interface
            if (! ($subscriber instanceof AnEventSubscriberInterface)) {
                throw new AnEventSubscriberException("Event Subscriber $identifier does not implement AnEventSubscriberInterface");
            }
        } else {
            $subscriber = $this->_event_subscribers[(string) $identifier];
        }
         
        return $subscriber;
    }
681041
public function clientListDb($offset = null, $limit = null)
  {
    return $this->execute("clientdblist -count", array("start" => $offset, "duration" => $limit))->toAssocArray("cldbid");
  }
406993
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) {
            if (is_string($params)) {
                $this->addListener($subscriberEvent, array($subscriber, $params));
            }

            if (is_array($params)) {
                foreach ($params as $param) {
                    $this->addListener($subscriberEvent, array($subscriber, $param));
                }
            }
        }
    }
193031
public function getMergeFields()
    {
        // since fev2017, MailChimp API doesn't handle null value en throw 400
        // errors when you try to add subscriber with a mergefields value to null
        foreach ($this->mergeFields as $key => $value) {
            if ($value === null) {
                unset($this->mergeFields[$key]);
            }
        }
        return $this->mergeFields;
    }
922873
public function getResult($limit = 0, $offset = 0)
    {
        if ($limit > 0 && false === $this->limitOffset($limit, $offset)) {
            return [];
        }

        $stmt = $this->queryBuilder->execute();
        $this->result = $stmt->fetchAll();

        return $this->result;
    }
1196097
protected function filterData(callable $matcher, $offset=0, $limit=null)
    {
        $filtered = [];

        $i=-1;
        $added = 0;

        foreach ($this->getData() as $item) {

            if (!$matcher($item)) {
                continue;
            }

            $i++;

            if ($i < $offset) {
                continue;
            }

            $filtered[] = $item;
            $added++;

            if ($limit !== null && $added >= $limit) {
                return $filtered;
            }

        }

        return $filtered;

    }
1279056
public Set<Method> subscriptionsOn(Object subscriber) {
        SubscriptionMethodFilter filter = new SubscriptionMethodFilter();
        Class<?> subscriberClass = subscriber.getClass();
        List<Method> methods = Arrays.asList(subscriberClass.getMethods());
        Set<Method> subscriptions = new HashSet<Method>();
        for (Method method : methods) {
            if (filter.accepts(method)) {
                subscriptions.add(method);
            }
        }
        return subscriptions;
    }
1225283
public function getMemberInfo($limit = null, $offset = 0, $memberRoleFilter = null, $memberInfoFilter = null, $appDefinedDataFilter = null)
    {
        $request = new GetGroupMemberInfoRequest($this->groupId, $limit, $offset, $memberRoleFilter, $memberInfoFilter, $appDefinedDataFilter);
        $response = new GetGroupMemberInfoResponse();
        return $this->client->sendRequest($request, $response);
    }
427801
public function limit($offset, $limit)
	{
		$data = array_slice($this->data, $offset, $limit);
		$this->setData($data);

		return $this;
	}
1139426
public function getPendingFriendships($limit = null, $offset = 0): array
    {
        return $this->findFriendshipsByStatus(Status::PENDING, $limit, $offset);
    }
625373
public function attachSubscriber(Subscriber $subscriber)
	{
		$listeners = $subscriber->getRegisteredEvents();
		foreach($listeners as $id => $listener) {
			EventManager::listenTo($id, array($subscriber, $listener));
		}
	}
594637
public function list(int $offset = 0, int $limit = 10)
    {
        $params = [
            'offset' => $offset,
            'limit' => $limit,
        ];

        return $this->httpPostJson('wxa/get_store_list', $params);
    }
170338
public function read( $offset = NULL, $limit = NULL )
	{
		return $this->load( $this->fileName, $offset, $limit );
	}