Storm\Core\Relational\Criterion::SetRangeOffset PHP Method

SetRangeOffset() final public method

Set the range offset.
final public SetRangeOffset ( integer $RangeOffset )
$RangeOffset integer
    public final function SetRangeOffset($RangeOffset)
    {
        if (!is_int($RangeOffset)) {
            throw new \Storm\Core\UnexpectedValueException('The supplied range offset must be a valid integer: %s given', \Storm\Core\Utilities::GetTypeOrClass($RangeOffset));
        }
        $this->RangeOffset = $RangeOffset;
    }

Usage Example

 /**
  * @access private
  * 
  * Maps the supplied object criterion the the relational equivalent.
  * 
  * @param IEntityRelationalMap $EntityRelationalMap The relational map of the object criterion
  * @param Object\ICriterion $ObjectCriterion The object criterion to map
  * @param Relational\Criterion $RelationalCriterion The relational criterion to map to
  * @return void
  */
 private function MapCriterion(IEntityRelationalMap $EntityRelationalMap, Object\ICriterion $ObjectCriterion, Relational\Criterion $RelationalCriterion)
 {
     if ($ObjectCriterion->IsConstrained()) {
         foreach ($this->MapExpressions($EntityRelationalMap, $ObjectCriterion->GetPredicateExpressions()) as $PredicateExpression) {
             $RelationalCriterion->AddPredicateExpression($PredicateExpression);
         }
     }
     if ($ObjectCriterion->IsOrdered()) {
         $ExpressionAscendingMap = $ObjectCriterion->GetOrderByExpressionsAscendingMap();
         foreach ($ExpressionAscendingMap as $Expression) {
             $IsAscending = $ExpressionAscendingMap[$Expression];
             $Expressions = $this->MapExpression($EntityRelationalMap, $Expression);
             foreach ($Expressions as $Expression) {
                 $RelationalCriterion->AddOrderByExpression($Expression, $IsAscending);
             }
         }
     }
     if ($ObjectCriterion->IsGrouped()) {
         foreach ($this->MapExpressions($EntityRelationalMap, $ObjectCriterion->GetGroupByExpressions()) as $GroupByExpression) {
             $RelationalCriterion->AddGroupByExpression($GroupByExpression);
         }
     }
     if ($ObjectCriterion->IsRanged()) {
         $RelationalCriterion->SetRangeOffset($ObjectCriterion->GetRangeOffset());
         $RelationalCriterion->SetRangeAmount($ObjectCriterion->GetRangeAmount());
     }
 }