From 169950e09cad0e69a7dcbcdabe7ef86086766483 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 20 Jan 2015 19:22:34 +0100 Subject: One class per file: framework/Collections/ --- .../TPagedListFetchDataEventParameter.php | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 framework/Collections/TPagedListFetchDataEventParameter.php (limited to 'framework/Collections/TPagedListFetchDataEventParameter.php') diff --git a/framework/Collections/TPagedListFetchDataEventParameter.php b/framework/Collections/TPagedListFetchDataEventParameter.php new file mode 100644 index 00000000..ea91f775 --- /dev/null +++ b/framework/Collections/TPagedListFetchDataEventParameter.php @@ -0,0 +1,86 @@ + + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Collections + */ + +/** + * TPagedListFetchDataEventParameter class. + * + * TPagedListFetchDataEventParameter is used as the parameter for + * {@link TPagedList::onFetchData OnFetchData} event. + * To obtain the new page index, use {@link getNewPageIndex NewPageIndex}. + * The {@link getOffset Offset} property refers to the index + * of the first item in the new page, while {@link getLimit Limit} + * specifies how many items are requested for the page. + * Newly fetched data should be saved in {@link setData Data} property. + * + * @author Qiang Xue + * @package System.Collections + * @since 3.0 + */ +class TPagedListFetchDataEventParameter extends TEventParameter +{ + private $_pageIndex; + private $_offset; + private $_limit; + private $_data=null; + + /** + * Constructor. + * @param integer new page index + * @param integer offset of the first item in the new page + * @param integer number of items in the new page desired + */ + public function __construct($pageIndex,$offset,$limit) + { + $this->_pageIndex=$pageIndex; + $this->_offset=$offset; + $this->_limit=$limit; + } + + /** + * @return integer the zero-based index of the new page + */ + public function getNewPageIndex() + { + return $this->_pageIndex; + } + + /** + * @return integer offset of the first item in the new page + */ + public function getOffset() + { + return $this->_offset; + } + + /** + * @return integer number of items in the new page + */ + public function getLimit() + { + return $this->_limit; + } + + /** + * @return mixed new page data + */ + public function getData() + { + return $this->_data; + } + + /** + * @param mixed new page data + */ + public function setData($value) + { + $this->_data=$value; + } +} \ No newline at end of file -- cgit v1.2.3