Get reviews for export.

@param \Magento\Store\Model\Website $website
@param int $limit

@return \Dotdigitalgroup\Email\Model\ResourceModel\Review\Collection
480928
public function _getReviewsToExport(\Magento\Store\Model\Website $website, $limit = 100)
    {
        return $this->reviewCollection->create()
            ->getReviewsToExportByWebsite($website, $limit);
    }
73371
public function indexItems($limit)
    {
        $errors     = 0;
        $indexRunId = uniqid();
        $configurationToUse = $this->site->getSolrConfiguration();
        $enableCommitsSetting = $configurationToUse->getEnableCommits();

        // get items to index
        $itemsToIndex = $this->indexQueue->getItemsToIndex($this->site, $limit);

        $this->emitSignal('beforeIndexItems', [$itemsToIndex, $this->getContextTask(), $indexRunId]);

        foreach ($itemsToIndex as $itemToIndex) {
            try {
                // try indexing
                $this->emitSignal('beforeIndexItem', [$itemToIndex, $this->getContextTask(), $indexRunId]);
                $this->indexItem($itemToIndex, $configurationToUse);
                $this->emitSignal('afterIndexItem', [$itemToIndex, $this->getContextTask(), $indexRunId]);
            } catch (\Exception $e) {
                $errors++;
                $this->indexQueue->markItemAsFailed($itemToIndex, $e->getCode() . ': ' . $e->__toString());
                $this->generateIndexingErrorLog($itemToIndex, $e);
            }
        }

        $this->emitSignal('afterIndexItems', [$itemsToIndex, $this->getContextTask(), $indexRunId]);

        if ($enableCommitsSetting && count($itemsToIndex) > 0) {
            $solrServers = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionsBySite($this->site);
            foreach ($solrServers as $solrServer) {
                try {
                    $solrServer->getWriteService()->commit(false, false, false);
                } catch (HttpException $e) {
                    $errors++;
                }
            }
        }

        return ($errors === 0);
    }
385150
public function getConfigSelectedCustomOrderAttributes($website = 0)
    {
        $customAttributes = $this->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_CUSTOM_ORDER_ATTRIBUTES,
            $website
        );
        if ($customAttributes) {
            return explode(',', $customAttributes);
        } else {
            return false;
        }
    }
1032450
public function getModifiedWishlistToImport(\Magento\Store\Api\Data\WebsiteInterface $website, $limit = 100)
    {
        return $this->wishlistCollection->create()
                                        ->getModifiedWishlistToImportByWebsite($website, $limit);
    }
1217026
public function search($query, $lang = 'en', $limit = 10) 
    {    
        $client = new Client(); 

        $response = $client->get(self::API_ENDPOINT, [
            'query' => [
                'action' => 'wbsearchentities',
                'format' => 'json',
                'strictlanguage' => true,
                'language' => $lang,
                'uselang' => $lang,
                'search' => $query,
                'limit' => $limit,
                'props' => ''
            ]
        ]);

        $results = json_decode($response->getBody(), true);

        $data = isset($results['search']) ? $results['search'] : [];

        $collection = collect($data);

        $output = $collection->map(function($item) use ($lang) {
            return new SearchResult($item, $lang, 'api');
        });

        return $output;
    }
1329610
public function getParameters($page = null, $limit = null)
    {
        $params = $this->params;

        $params[$this->pageParam]  = null == $page  ? $this->getPage()  : $page;
        $params[$this->limitParam] = null == $limit ? $this->getLimit() : $limit;

        return $params;
    }
485891
public function read($limit = 5)
    {
        $read = Auth::user()->notifications()->whereNotNull('read_at')->take($limit)->get();

        return $read->map(function ($item) {
            return $this->toCollect($item);
        });
    }
269403
public function findAllPaged($page = 0, $limit = 20) {
    $results = $this->findAllWithoutFetchPaged($page, $limit);
    $return = $this->hydrate($results);

    return $return;
  }
21028
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_VCSS, VersionControlProvider::class);

        return $this->getPaginator($dql, $limit, $page);
    }
70528
public function getSearchResults($pattern, $start = 0, $limit = 50)
    {
        $terms = $this->parse($pattern);
        $results = array();
        
        //sort searchServices by order
        $sortedSearchServices = array();
        foreach($this->searchServices as $service) {
            $sortedSearchServices[$service->getOrder()] = $service;
        }
        
        if ($terms['_domain'] !== NULL) {
            foreach ($sortedSearchServices as $service) {
                if ($service->supports($terms['_domain'])) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
            
            if (count($results) === 0) {
                throw new UnknowSearchDomainException($terms['_domain']);
            }
        } else { // no domain provided, we use default search
            foreach($sortedSearchServices as $service) {
                if ($service->isActiveByDefault()) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
        }
        
        //sort array
        ksort($results);

        return $results;
    }
813012
public function getPendingConnectorOrders($website, $limit = 100)
    {
        $orders = [];
        $storeIds = $website->getStoreIds();
        /** @var \Dotdigitalgroup\Email\Model\Order $orderModel */
        $orderModel = $this->orderFactory->create();
        //get order statuses set in configuration section
        $orderStatuses = $this->helper->getConfigSelectedStatus($website);

        //no active store for website
        if (empty($storeIds) || empty($orderStatuses)) {
            return [];
        }

        //pending order from email_order
        $orderCollection = $orderModel->getOrdersToImport($storeIds, $limit, $orderStatuses);

        //no orders found
        if (! $orderCollection->getSize()) {
            return $orders;
        }

        $orders = $this->mappOrderData($orderCollection, $orderModel, $orders);

        return $orders;
    }
309644
protected function getLimit($limit = null)
    {
        if (null === $limit) {
            $limit = $this->getDefaultLimit();
        }

        return $this->validateLimit($limit);
    }
1140441
public function getWishlistToImportByWebsite(\Magento\Store\Api\Data\WebsiteInterface $website, $limit = 100)
    {
        $collection = $this->addFieldToFilter('wishlist_imported', ['null' => true])
            ->addFieldToFilter(
                'store_id',
                ['in' => $website->getStoreIds()]
            )
            ->addFieldToFilter('item_count', ['gt' => 0]);
        $collection->getSelect()->limit($limit);

        return $collection;
    }
406153
public function isCustomerSyncEnabled($website = 0)
    {
        $website = $this->storeManager->getWebsite($website);

        return $this->scopeConfig->isSetFlag(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_CUSTOMER_ENABLED,
            \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE,
            $website
        );
    }
423255
public function getByLimit(int $limit, array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->take($limit)->get();
    }
476680
public function getPaginated($page = 1, $limit = 10)
    {
        $query = $this->make();
        $collection = $query->forPage($page, $limit)->get();
        return new PaginatedResult($page, $limit, $collection->count(), $collection);
    }
1186112
public function getAvailableRollbacksByTarget(Target $target, $limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_ROLLBACKS, Release::class);
        $params = [
            'target' => $target,
            'release_status' => JobStatusEnum::TYPE_SUCCESS,
            'build_status' => JobStatusEnum::TYPE_SUCCESS,
        ];

        return $this->getPaginator($dql, $limit, $page, $params);
    }