TrackManiaControl/libs/FML/Script/Features/PagingPage.php

94 lines
1.8 KiB
PHP
Raw Normal View History

2014-04-27 14:44:40 +02:00
<?php
namespace FML\Script\Features;
use FML\Controls\Control;
/**
2014-06-21 03:18:21 +02:00
* Paging Page
2014-04-27 14:44:40 +02:00
*
2014-05-20 15:44:45 +02:00
* @author steeffeen <mail@steeffeen.com>
2017-03-25 18:40:15 +01:00
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
2014-05-18 19:45:50 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
2014-04-27 14:44:40 +02:00
*/
2017-03-25 18:40:15 +01:00
class PagingPage
{
2014-04-27 14:44:40 +02:00
2017-03-25 18:40:15 +01:00
/**
* @var Control $control Page Control
*/
protected $control = null;
2014-04-27 14:44:40 +02:00
2017-03-25 18:40:15 +01:00
/**
* @var int $pageNumber Page number
*/
protected $pageNumber = null;
2014-04-27 14:44:40 +02:00
2017-03-25 18:40:15 +01:00
/**
* Construct a new Paging Page
*
* @api
* @param Control $control (optional) Page Control
* @param int $pageNumber (optional) Number of the Page
*/
public function __construct(Control $control = null, $pageNumber = null)
{
if ($control) {
$this->setControl($control);
}
if ($pageNumber) {
$this->setPageNumber($pageNumber);
}
}
2014-04-27 14:44:40 +02:00
2017-03-25 18:40:15 +01:00
/**
* Get the Page Control
*
* @api
* @return Control
*/
public function getControl()
{
return $this->control;
}
/**
* Set the Page Control
*
* @api
* @param Control $control Page Control
* @return static
*/
public function setControl(Control $control)
{
$control->checkId();
$this->control = $control;
return $this;
}
/**
* Get the Page number
*
* @api
* @return int
*/
public function getPageNumber()
{
return $this->pageNumber;
}
/**
* Set the Page number
*
* @api
* @param int $pageNumber Number of the Page
* @return static
*/
public function setPageNumber($pageNumber)
{
$this->pageNumber = (int)$pageNumber;
return $this;
}
2014-04-27 14:44:40 +02:00
}