protected function prepareModels() {
		if(!$this->query instanceof QueryInterface) {
			throw new InvalidConfigException(
				'The "query" property must be an instance of a class that implements the '.
				'chsergey\rest\QueryInterface or its subclasses.'
			);
		}

		$query = clone $this->query;

		$this->setPagination([
			'pageSizeLimit' => [1, 1000]
		]);

		if (($pagination = $this->getPagination()) !== false) {
			$pagination->totalCount = $this->getTotalCount();
			$query->limit($pagination->getLimit())
				->offset($pagination->getOffset());
		}

		return $query->all();
	}
protected function prepareModels() {
		if(!$this->query instanceof QueryInterface) {
			throw new InvalidConfigException(
				'The "query" property must be an instance of a class that implements the '.
				'chsergey\rest\QueryInterface or its subclasses.'
			);
		}

		$query = clone $this->query;

		$this->setPagination([
			'pageSizeLimit' => [1, 1000]
		]);

		if (($pagination = $this->getPagination()) !== false) {
			$pagination->totalCount = $this->getTotalCount();
			$query->limit($pagination->getLimit())
				->offset($pagination->getOffset());
		}

		return $query->all();
	}
protected function prepareModels ( ) { if ( ! $ this -> query instanceof QueryInterface ) { throw new InvalidConfigException ( 'The "query" property must be an instance of a class that implements the ' . 'chsergey\rest\QueryInterface or its subclasses.' ) ; } $ query = clone $ this -> query ; $ this -> setPagination ( [ 'pageSizeLimit' => [ 1 , 1000 ] ] ) ; if ( ( $ pagination = $ this -> getPagination ( ) ) !== false ) { $ pagination -> totalCount = $ this -> getTotalCount ( ) ; $ query -> limit ( $ pagination -> getLimit ( ) ) -> offset ( $ pagination -> getOffset ( ) ) ; } return $ query -> all ( ) ; }
Prepares the data models that will be made available in the current page.
@return array the available data models
@throws InvalidConfigException
Prepares the data models that will be made available in the current page .