Sets current page and calculates offset

@param integer $value The number of the current page.

@return Pagination A self instance for method chain calls
9145
public function setCurrent($value)
    {
        if (!StaticValidator::isValid('number', $value)) {
            return $this;
        }

        $this->_current = StaticFilter::filter('number',$value);
        $this->_offset = $this->_rowsPerPage * ($this->_current - 1);
        return $this;
    }
478870
public function setValue($value)
    {
        $this->_value = $value;
        $this->getInput()->setValue($value);
        return $this;
    }
391581
public function offsetSet($offset, $value)
    {
        if ($offset === null) {
            $offset = count($this->session[$this->prefix]);
        }

        $this->session[$this->prefix][$offset] = $value;
    }
70705
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
            if (is_numeric($offset)) {
                $this->length = (int)$offset;
            }
        }
    }
336553
public function offsetSet($offset, $value)
    {
        $iterator = $this->getIterator();
        $iterator->offsetSet($offset, $value);

        // @codeCoverageIgnoreStart
    //
    // This method always throws an exception, so we ignore the closing
    // brace
    }
790585
public function setPage($value)
    {
        if ($value === null || $value === '') {
            $this->_page = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_page = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid status value in PaymentsRequest', 0, 'PaymentsRequest.page', $value
            );
        }
    }
365252
public function offsetSet($offset, $value)
    {
        if (property_exists(get_class($this), $offset)) {
            $property = new ReflectionProperty(get_class($this), $offset);
            if ($property->isPublic()) {
                $this->$offset = $value;
            }

            return;
        }

        $this->$offset = $value;
    }
1306147
public function setValue($value)
    {

        if (isset($this->element)) {
            $this->element->setValue($value);
        }

        return $this;
    }
878419
public function setValue( $value )
    {
        // Only set cell value for single cells
        if (!str_contains( $this->cells, ':' )) {
            $this->sheet->setCellValue( $this->cells, $value );
        }

        return $this;
    }
785065
public function offsetSet($offset, $value)
    {
        if ( ! $value instanceof Closure) {
            $value = function() use ($value) {
                return $value;
            };
        }
        $this->bind($offset, $value);
    }
848806
public function setCorePhpthumbCacheMaxage($value)
    {
        $this->setFieldName('phpthumb_cache_maxage');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1053216
public function setPagination()
    {

        $total = $this->getListTotal();

        if (empty($total))
            return null;

        //Get the current page state from the request;
        $limit = $this->getListLimit();
        $current = $this->getState("currentpage", 1);
        $pages = array();

        //@TODO: Calculates the pages from a recordset or an array of results
        $pages['total'] = ceil($total / $limit);
        $pages['limit'] = $limit;

        //Get the real path to the current page
        $route = $this->container->router->getMatchedRoute();


        $pages['current'] = $route->getURLfromPathWithValues(["page" => strval($current)]);
        //Previous page link
        if (intval($current - 1) > 0):
            $pages['previous'] = $route->getURLfromPathWithValues(["page" => strval($current - 1)] );
        endif;
        //Next page link
        if (intval($current + 1) <= $pages['total']):
            $pages['next'] = $route->getURLfromPathWithValues(["page" => strval($current + 1)] );
        endif;

        //Build the pages;
        for ($i = 0; $i < $pages['total']; $i++):
            $page = $i + 1;
            $pages['pages'][] = array(
                "page_title" => strval($page),
                "page_link" => $route->getURLfromPathWithValues(["page" => $page] ),
                "page_state" => ($page == $current) ? "active" : null,
            );
        endfor;

        //Sets the pagination output;
        if (sizeof($pages['pages']) > 1)
            $this->pagination = $pages;

    }
32433
public function setDiscount($value)
    {
        $this->data->amount->subtotals->discount = (float) $value;

        return $this;
    }
399271
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $offset = $this->_integerToStringKey($this->_integerKeysCounter++);
        }

        $this->_putData($offset, $value);
        return $this;
    }
1375039
public function offsetSet($offset, $value)
    {
        $head = null;
        $offset = $this->computeOffset($offset);

        if (0 < $offset) {
            $head = \mb_substr($this->_string, 0, $offset);
        }

        $tail = \mb_substr($this->_string, $offset + 1);
        $this->_string = $head . $value . $tail;
        $this->_direction = null;

        return $this;
    }
679513
public function setRange($value)
    {
        if ($value != null) {
            $this->_params['range'] = $value;
        } else {
            unset($this->_params['range']);
        }
        return $this;
    }
300815
public function setPage($page)
    {
        if ($page < 1) {
            $page = 1;
        }

        if ($this->range == 0) {
            $this->setRange(25);
        }

        $this->start = ($page - 1) * $this->range;

        return $this;
    }