Doctrine\Common\Collections\ArrayCollection::next PHP Method

next() public method

{@inheritDoc}
public next ( )
    public function next()
    {
        return next($this->elements);
    }

Usage Example

 /**
  * @see ExecutableInterface::execute()
  */
 public function execute()
 {
     if (!$this->isStarted()) {
         throw new \Exception('Procedure not started');
     }
     if (!$this->getCurrentUnitProcedure()) {
         $this->setFinished();
         return;
     }
     // Start the next unit procedure?
     if ($this->getCurrentUnitProcedure()->isFinished()) {
         // Go to next unit procedure if possible
         if ($this->unitProcedures->next()) {
             $this->getCurrentUnitProcedure()->setEventDispatcher($this->eventDispatcher);
             $this->getCurrentUnitProcedure()->start();
         } else {
             // If last unit procedure is finished
             // set the finished flag
             $this->setFinished();
         }
     }
     // Execute
     if (!$this->finished && $this->getCurrentUnitProcedure()->isStarted()) {
         // Perform unit procedure
         $this->getCurrentUnitProcedure()->execute();
     }
 }
All Usage Examples Of Doctrine\Common\Collections\ArrayCollection::next