示例#1
0
 /**
  * Prepares the Iterator to work
  */
 protected function initialize()
 {
     if ($this->ids === null) {
         $this->iterationMin = 1;
         $this->iterationMax = $this->imap->count();
     } else {
         $this->iterationMin = 0;
         $this->iterationMax = count($this->ids) - 1;
     }
 }
 /**
  * Rewind the Iterator to the first element
  */
 public function rewind()
 {
     if ($this->ids === null) {
         $this->iterationMin = 1;
         $this->iterationMax = $this->imap->count();
     } else {
         $this->iterationMin = 0;
         $this->iterationMax = count($this->ids) - 1;
     }
     if ($this->reverse) {
         $this->iterationPos = $this->iterationMax;
     } else {
         $this->iterationPos = $this->iterationMin;
     }
 }