Set collection to pager.

@param \Mirasvit\Blog\Model\ResourceModel\Post\Collection $collection
@return $this
17047
public function setCollection($collection)
    {
        $this->collection = $collection;

        $this->collection->setCurPage($this->getCurrentPage());

        // we need to set pagination only if passed value integer and more that 0
        $limit = (int)$this->getLimit();
        if ($limit) {
            $this->collection->setPageSize($limit);
        }
        if ($this->getCurrentOrder()) {
            $this->collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
        }

        return $this;
    }
438916
public function updateCollection(Collection $collection): void
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->update('ngbm_collection')
            ->set('start', ':start')
            ->set('length', ':length')
            ->set('translatable', ':translatable')
            ->set('main_locale', ':main_locale')
            ->set('always_available', ':always_available')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $collection->id, Type::INTEGER)
            ->setParameter('start', $collection->offset, Type::INTEGER)
            ->setParameter('length', $collection->limit, Type::INTEGER)
            ->setParameter('translatable', $collection->isTranslatable, Type::BOOLEAN)
            ->setParameter('main_locale', $collection->mainLocale, Type::STRING)
            ->setParameter('always_available', $collection->alwaysAvailable, Type::BOOLEAN);

        $this->applyStatusCondition($query, $collection->status);

        $query->execute();
    }
1141014
protected function dispatchCollection($collection)
    {
        // find and send group variables
        $group = isset($collection['group']) ? $collection['group'] : null;
        // dispatch action dispatcher
        $content = $this->getActionDispatcher()->dispatch($collection['action'], $group);
        if (is_string($content)) {
            $this->sendContentString($content, $this->getRequest());
        }
    }
860055
private static function _addCustomAttributes(Collection $collection)
    {
        if (self::$_customPaginationPresenter) {
            $collection->setPaginationPresenter(self::$_customPaginationPresenter);
        }
        if (self::$_customView) {
            $collection->view(self::$_customView);
        }
        if (self::$_customCustomView) {
            $collection->customView(self::$_customCustomView);
        }
        if (self::$_customPaginate) {
            $collection->paginate(self::$_customPaginate);
        }
        if (self::$_customPerPage) {
            $collection->perPage(self::$_customPerPage);
        }
        if (self::$_customPage) {
            $collection->page(self::$_customPage);
        }
        if (self::$_customFilter) {
            $collection->filter(self::$_customFilter);
        }
        if (self::$_rendererNamespace) {
            $collection->setRendererNamespace(self::$_rendererNamespace);
        }

        return $collection;
    }
8247
public function loadCollection(PersistentCollection $collection)
    {
        $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);
    }
89804
public static function get_metadata(collection $collection) : collection {
        $collection->add_subsystem_link('core_completion', [], 'privacy:metadata:completionsummary');
        $collection->add_subsystem_link('core_favourites', [], 'privacy:metadata:favouritessummary');
        $collection->add_user_preference('coursecat_management_perpage', 'privacy:perpage');
        return $collection;
    }
45724
public function setCollection(array $collection)
    {
        if (is_array($this->buildItems) 
                && array_key_exists('collection', $this->buildItems) 
                && !empty($this->buildItems['collection'])) {
            unset($this->collection);
        }
        $this->setBuildItems();
        foreach ($collection as $builder) {
            $this->addBuilder($builder);
        }
        
        return $this;
    }
73054
private function trackCollection(Collection $collection)
    {
        $blocks = $collection->getBlocks();
        $this->trackBlocks($collection, $blocks);
    }
1183270
public function from($collection, $properties = null) {
		$this->_collection = $collection;
		
		if (is_string($properties) || is_array($properties)) {
			$this->_properties = (array) $properties;
		}
		
		return $this;
	}
944128
public function apply(Collection $collection)
    {
        $this->collection = $collection;

        foreach ($this->filters() as $name => $value) {
            if (! method_exists($this, $name)) {
                continue;
            }

            if (is_array($value) or trim($value)) {
                $this->collection = $this->$name($value);
            } else {
                $this->collection = $this->$name();
            }
        }

        return $this->collection;
    }
290038
public function addManyToManyCollections($collections)
    {
        if (!is_array($collections)) {
            $collections = [$collections];
        }
        $this->manyToManyCollections = array_merge($this->manyToManyCollections, $collections);

        return $this;
    }
385736
public function addManagedCollections($collections)
    {
        if (!is_array($collections)) {
            $collections = array($collections);
        }
        $this->managedCollections = array_merge($this->managedCollections, $collections);

        return $this;
    }
1281935
public function setCollection(\collection $collection = null)
    {
        if ($collection === null) {
            $this->baseId = null;

            return;
        }
        $this->baseId = $collection->get_base_id();
    }
645949
public function newCollectionUpdateStruct(?Collection $collection = null): CollectionUpdateStruct
    {
        $collectionUpdateStruct = new CollectionUpdateStruct();

        if ($collection !== null) {
            $collectionUpdateStruct->offset = $collection->getOffset();
            $collectionUpdateStruct->limit = $collection->getLimit() ?? 0;
        }

        return $collectionUpdateStruct;
    }
1214903
public function makeCollection(ArrayAccess $collection, array $meta = [], TransformerAbstract $transformer = null)
    {
        if ($this->isPaged($collection)) {
            $paginator = $collection;
            $collection = $collection->getIterator();
            $resource = $this->makeFractalCollection($collection, $this->getTransformer($transformer));
            $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
        } else {
            $resource = $this->makeFractalCollection($collection, $this->getTransformer($transformer));
        }

        $resource = $this->addFractalMeta($resource, $meta);

        $fractal = $this->getFractalFactory()->createData($resource)->toArray();

        return $fractal;
    }
1037616
public void setCollection(String collection) throws PageException {
	String[] collNames = ListUtil.toStringArrayTrim(ListUtil.listToArrayRemoveEmpty(collection, ','));
	collections = new SearchCollection[collNames.length];
	SearchEngine se = pageContext.getConfig().getSearchEngine(pageContext);
	try {
	    for (int i = 0; i < collections.length; i++) {
		collections[i] = se.getCollectionByName(collNames[i]);
	    }
	}
	catch (SearchException e) {
	    collections = null;
	    throw Caster.toPageException(e);
	}
    }
905901
public static function get_metadata(collection $collection) : collection {
        $collection->add_user_preference('block_timeline_user_sort_preference', 'privacy:metadata:timelinesortpreference');
        $collection->add_user_preference('block_timeline_user_filter_preference', 'privacy:metadata:timelinefilterpreference');
        $collection->add_user_preference('block_timeline_user_limit_preference', 'privacy:metadata:timelinelimitpreference');
        return $collection;
    }