Author: peter
Date: 2008-09-29 10:06:10 -0700 (Mon, 29 Sep 2008)
New Revision: 1395
Modified:
trunk/apps/qubit/lib/SearchPager.class.php
Log:
code standard & peer review clean-up
Modified: trunk/apps/qubit/lib/SearchPager.class.php
===================================================================
--- trunk/apps/qubit/lib/SearchPager.class.php 2008-09-28 22:44:38 UTC (rev
1394)
+++ trunk/apps/qubit/lib/SearchPager.class.php 2008-09-29 17:06:10 UTC (rev
1395)
@@ -20,22 +20,22 @@
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
+ */
/*
* @package Qubit
* @author Peter Van Garderen <[EMAIL PROTECTED]>
* @version svn:$Id$
-*/
+ */
class searchPager
{
-
- /**
+ /*
* Class constructor
*
* @param array $hits array of objects returned as hits from Zend Lucene
Search
* @param integer $page current page of hits to display
+ *
*/
function __construct($hits, $page)
{
@@ -70,14 +70,11 @@
$this->hits = array_slice($hits, $this->start, $this->perPage);
}
-
function getCurrentPage()
{
-
return $this->page;
}
-
function getPages()
{
$links = array();
@@ -89,29 +86,22 @@
return $links;
}
-
function haveToPaginate()
{
-
- return $haveToPaginate = count($this->allHits) > $this->perPage ? true :
false;
+ return count($this->allHits) > $this->perPage;
}
-
function getHits()
{
-
return $this->hits;
}
-
function getFirstHit()
{
-
return (($this->page - 1) * $this->perPage) + 1;
}
-
function getLastHit()
{
if (count($this->getPages()) > $this->getCurrentPage())
@@ -126,4 +116,4 @@
}
}
-}
\ No newline at end of file
+}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---