Changeset 6172
- Timestamp:
- 11/27/07 04:00:35 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfUtilitiesPlugin/trunk/data/tasks/sfCommandLineTask.php
r6169 r6172 1 1 <?php 2 /* 3 * This file is part of the sfUtilitiesPlugin package. 4 * 5 * For the full copyright and license information, please view the LICENSE 6 * file that was distributed with this source code. 7 */ 2 8 3 9 pake_desc('Run a batch'); plugins/sfUtilitiesPlugin/trunk/lib/sfArrayPager.class.php
r6161 r6172 1 1 <?php 2 /* 3 * This file is part of the sfUtilitiesPlugin package. 4 * 5 * For the full copyright and license information, please view the LICENSE 6 * file that was distributed with this source code. 7 */ 8 2 9 class sfArrayPager extends sfPager 3 10 { … … 8 15 $this->setNbResults(count($this->resultsArray)); 9 16 10 if (($this->getPage() == 0 || $this->getMaxPerPage() == 0)) 11 { 12 $this->setLastPage(0); 13 } 14 else 15 { 16 $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage())); 17 if (($this->getPage() == 0 || $this->getMaxPerPage() == 0)) { 18 $this->setLastPage(0); 19 } else { 20 $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage())); 17 21 } 18 22 } … … 36 40 { 37 41 return array_slice( 38 $this->resultsArray,39 ($this->getPage() - 1) * $this->getMaxPerPage(),40 $this->maxPerPage41 );42 $this->resultsArray, 43 ($this->getPage() - 1) * $this->getMaxPerPage(), 44 $this->maxPerPage 45 ); 42 46 } 43 47 }