Development

Changeset 6172

You must first sign up to be able to contribute.

Changeset 6172

Show
Ignore:
Timestamp:
11/27/07 04:00:35 (5 years ago)
Author:
kupokomapa
Message:

[sfUtilitiesPlugin] Added new class sfArrayCache. Also added licence information in all the other files.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfUtilitiesPlugin/trunk/data/tasks/sfCommandLineTask.php

    r6169 r6172  
    11<?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 */ 
    28 
    39pake_desc('Run a batch'); 
  • plugins/sfUtilitiesPlugin/trunk/lib/sfArrayPager.class.php

    r6161 r6172  
    11<?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 
    29class sfArrayPager extends sfPager 
    310{ 
     
    815    $this->setNbResults(count($this->resultsArray)); 
    916  
    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())); 
    1721    } 
    1822  } 
     
    3640  { 
    3741    return array_slice( 
    38      $this->resultsArray,  
    39      ($this->getPage() - 1) * $this->getMaxPerPage(),  
    40      $this->maxPerPage 
    41    ); 
     42      $this->resultsArray,  
     43      ($this->getPage() - 1) * $this->getMaxPerPage(),  
     44      $this->maxPerPage 
     45    ); 
    4246  } 
    4347}