Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AuthorCollectionIterator.php

class AuthorCollectionIterator

@template-implements Iterator<int,Author>

Hierarchy

  • class \PharIo\Manifest\AuthorCollectionIterator implements \Iterator

Expanded class hierarchy of AuthorCollectionIterator

File

vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php, line 17

Namespace

PharIo\Manifest
View source
class AuthorCollectionIterator implements Iterator {
    
    /** @var Author[] */
    private $authors;
    
    /** @var int */
    private $position = 0;
    public function __construct(AuthorCollection $authors) {
        $this->authors = $authors->getAuthors();
    }
    public function rewind() : void {
        $this->position = 0;
    }
    public function valid() : bool {
        return $this->position < count($this->authors);
    }
    public function key() : int {
        return $this->position;
    }
    public function current() : Author {
        return $this->authors[$this->position];
    }
    public function next() : void {
        $this->position++;
    }

}

Members

Title Sort descending Modifiers Object type Summary
AuthorCollectionIterator::$authors private property @var Author[]
AuthorCollectionIterator::$position private property @var int
AuthorCollectionIterator::current public function
AuthorCollectionIterator::key public function
AuthorCollectionIterator::next public function
AuthorCollectionIterator::rewind public function
AuthorCollectionIterator::valid public function
AuthorCollectionIterator::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal