Operation getSchoolAdminsAsync



@param  int $limit (optional)
@param  string $starting_after (optional)
@param  string $ending_before (optional)

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
166802
public function getSchoolAdminsAsync($limit = null, $starting_after = null, $ending_before = null)
    {
        return $this->getSchoolAdminsAsyncWithHttpInfo($limit, $starting_after, $ending_before)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
263821
public function getFeed($limit = 12)
    {
        if (empty($this->userName)) {
            throw new InstagramException('Username cannot be empty');
        }

        if ($this->endCursor) {
            if (!$this->cacheManager instanceof CacheManager) {
                throw new CacheException('CacheManager object must be specified to use pagination');
            }

            $feed     = new JsonTransportFeed($this->client, $this->endCursor, $this->cacheManager);
            $hydrator = new JsonHydrator();
        } else {
            $feed     = new HtmlTransportFeed($this->client, $this->cacheManager);
            $hydrator = new HtmlHydrator();
        }

        $dataFetched = $feed->fetchData($this->userName, $limit);

        $hydrator->setData($dataFetched);

        return $hydrator->getHydratedData();
    }
383239
public function fetch($class, array $filters = [], array $sortBy = null, $page = 0, $limit = -1, $count = false)
    {
        try {
            return $this->get($class)->find($filters, $sortBy, $page, $limit, $count);
        } catch (FinderException $e) {
            $data = $this->om->getRepository($class)->findBy($filters, null, 0 < $limit ? $limit : null, $page);

            return $count ? count($data) : $data;
        }
    }
216990
public function findLimited($limit = 0)
    {
        $queryBuilder = $this->createQueryBuilder('c')
            ->where('c.enabled = :enabled')
            ->orderBy('c.position')
            ->setParameters(array(
                'enabled' => true,
            ));

        if ($limit != 0) {
            $queryBuilder->setMaxResults($limit);
        }

        return $queryBuilder->getQuery()->getResult();
    }
631182
public function historyActivity($start = null, $end = null)
    {
        $url = $this->_baseURL . "/historyrecord";
        $flag = "?";
        if (!empty($start)) {
            $url = $url . $flag . "start=" . $start;
            $flag = "&";
        }
        if (!empty($end)) {
            $url = $url . $flag . "end=" . $end;
        }
        return $this->_transport->send(HttpRequest::GET, $url);
    }
566200
public function getPending($limit = 10)
    {
        $results = $this->getCollection()
            ->find(array('processed' => false))
            ->limit($limit);

        return iterator_to_array($results);
    }
852055
public function getSearchRequest($filter, $limit = 1, $conditions = [])
    {
        $self = $this;

        return new StorageDataRequest(
            [$limit, $conditions],
            function ($limit, $conditions) use ($self) {
                $timeout = $conditions['timeout'] ?? 1;
                $consumer = $self->getRouter()->getConsumer($self->getResource(), $timeout);
                $results = [];

                while ($limit--) {
                    $results[] = $consumer->readOne();
                }

                return $results;
            }
        );
    }
1209372
public function getByProjectId($value, $limit = 1000, $useConnection = 'read')
    {
        if (is_null($value)) {
            throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
        }


        $query = 'SELECT * FROM `build` WHERE `project_id` = :project_id LIMIT :limit';
        $stmt = Database::getConnection($useConnection)->prepare($query);
        $stmt->bindValue(':project_id', $value);
        $stmt->bindValue(':limit', (int)$limit, \PDO::PARAM_INT);

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return new Build($item);
            };
            $rtn = array_map($map, $res);

            $count = count($rtn);

            return array('items' => $rtn, 'count' => $count);
        } else {
            return array('items' => array(), 'count' => 0);
        }
    }
681041
public function clientListDb($offset = null, $limit = null)
  {
    return $this->execute("clientdblist -count", array("start" => $offset, "duration" => $limit))->toAssocArray("cldbid");
  }
987836
public function limit($limit = 120, $end = '...') {
        $returnValue = $this->string;

        if($this->length() > $limit) {
            $returnValue = rtrim((string) $this->first($limit)->toString()) . $end;
        }

        return $this->createClone($returnValue);
    }
143808
protected function getAsync(array $endpoints, $params = [])
    {
        /** @var Promise[] $promises */
        $promises = array_map(function (Endpoint $endpoint) use ($params) {
            $isCached = $this->client->getCache() && $this->client->getCache()->getItem(KeyGenerator::fromEndpoint($endpoint))->isHit();
            
            if ($endpoint->countsTowardsLimit() && !$isCached) {
                try {
                    $this->client->getMethodRateLimiter()->hit($endpoint);
                    $this->client->getAppRateLimiter()->hit($endpoint);
                } catch (RateLimitReachedException $e) {
                    return new RejectedPromise($e);
                }
            }

            return $this->client->getHttpClient()
                ->sendAsyncRequest($this->buildRequest($endpoint, $params))
                ->then(function (ResponseInterface $response) use ($endpoint) {
                    return $response
                        ->withHeader('X-Endpoint', $endpoint->getName())
                        ->withHeader('X-Request', $endpoint->getUrl())
                        ->withHeader('X-Region', $endpoint->getRegion()->getName());
                });
        }, is_array($endpoints) ? $endpoints : [$endpoints]);

        // Wait for multiple requests to complete, even if some fail
        if (count($promises) > 1) {
            $results = \GuzzleHttp\Promise\settle($promises)->wait();

            return BatchResult::fromSettledPromises($results);
        }

        // Resolve a single request
        $result = $promises[0]->wait();

        if (! $result instanceof ResponseInterface) {
            throw $result;
        }

        return Result::fromPsr7($result);
    }
445527
protected function fetchNewsItems($begin, $end, $limit = null, $offset = null)
    {
        if (($criteria = $this->getSearchCriteria($begin, $end)) === null) {
            return null;
        }

        $criteria->setLimit($limit);
        $criteria->setOffset($offset);

        return NewsModel::findBy($criteria->getColumns(), $criteria->getValues(), $criteria->getOptions());
	}
1276881
public function getCustomList(QueryBuilder $queryBuilder, $start = 0, $limit = 0)
    {
        $parameters = array(
            'select' => $queryBuilder->getSelect(),
            'where'  => $queryBuilder->getWhere(),
            'order'  => $queryBuilder->getOrder(),
            'start'  => $start,
            'limit'  => $limit,
        );

        $parameters = array_filter($parameters);

        $supported = $this->isSupported('getList');

        return (true === $supported) ? $this->makeRequest($this->endpoint, $parameters) : $supported;
    }
396208
public function get($limit = null, $offset = null)
    {
        if (isset($limit)) {
            $this->limit($limit, $offset);
        }

        if (false !== ($result = $this->conn->query($this->builderCache))) {
            $result->setTotalRows($this->countAllResults(true));
        }

        $this->builderCache->reset();

        return $result;
    }
503919
public function paginate($start, $limit, $fetchJoinCollection = true)
    {
        $this->setFirstResult($start)
             ->setMaxResults($limit);

        return new Paginator($this, $fetchJoinCollection);
    }
759354
public function get_entries($start=0, $limit=10) {
        global $DB;

        if ($this->entries === null) {
            if ($sqlarray = $this->get_entry_fetch_sql(false, 'created DESC')) {
                $this->entries = $DB->get_records_sql($sqlarray['sql'], $sqlarray['params'], $start, $limit);
                if (!$start && count($this->entries) < $limit) {
                    $this->totalentries = count($this->entries);
                }
            } else {
                return false;
            }
        }

        return $this->entries;
    }
256999
public function findLastPostQueryBuilder($limit)
    {
        return $this->createQueryBuilder()
            ->field('enabled')->equals(true)
            ->sort('createdAt', 'desc')
            ->limit($limit)
            ->getQuery()
            ->execute();
    }