public function setRange($startIndex, $maxItems)
    {
        $changed = false;
        if (sizeof($this->sorts) == 0) {
            $this->addSort(SolutionSchema::getModelSchema($this->getModelClassName())->uniqueIdentifierColumnName);
        }

        if ($this->rangeStartIndex != $startIndex) {
            $this->rangeStartIndex = $startIndex;
            $changed = true;
        }

        if ($this->rangeEndIndex !== $startIndex + $maxItems - 1) {
            $this->rangeEndIndex = $startIndex + $maxItems - 1;
            $changed = true;
        }

        if ($changed) {
            // Ranges can often be reset to the same values in which case we don't want to invalidate the list
            // as that would cause another query being sent to the database.
            $this->invalidate();
        }

        return $this;
    }
public function setRange($startIndex, $maxItems)
    {
        $changed = false;
        if (sizeof($this->sorts) == 0) {
            $this->addSort(SolutionSchema::getModelSchema($this->getModelClassName())->uniqueIdentifierColumnName);
        }

        if ($this->rangeStartIndex != $startIndex) {
            $this->rangeStartIndex = $startIndex;
            $changed = true;
        }

        if ($this->rangeEndIndex !== $startIndex + $maxItems - 1) {
            $this->rangeEndIndex = $startIndex + $maxItems - 1;
            $changed = true;
        }

        if ($changed) {
            // Ranges can often be reset to the same values in which case we don't want to invalidate the list
            // as that would cause another query being sent to the database.
            $this->invalidate();
        }

        return $this;
    }
public function setRange ( $ startIndex , $ maxItems ) { $ changed = false ; if ( sizeof ( $ this -> sorts ) == 0 ) { $ this -> addSort ( SolutionSchema :: getModelSchema ( $ this -> getModelClassName ( ) ) -> uniqueIdentifierColumnName ) ; } if ( $ this -> rangeStartIndex != $ startIndex ) { $ this -> rangeStartIndex = $ startIndex ; $ changed = true ; } if ( $ this -> rangeEndIndex !== $ startIndex + $ maxItems - 1 ) { $ this -> rangeEndIndex = $ startIndex + $ maxItems - 1 ; $ changed = true ; } if ( $ changed ) { // Ranges can often be reset to the same values in which case we don't want to invalidate the list // as that would cause another query being sent to the database. $ this -> invalidate ( ) ; } return $ this ; }
Limits the range of iteration from startIndex to startIndex + maxItems

This can be used by the repository to employ limits but generally allows for easy paging of a list.

@param int $startIndex
@param int $maxItems
@return $this
Limits the range of iteration from startIndex to startIndex + maxItems