You are here

public function ArrayObject::setIteratorClass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/ArrayObject.php \Zend\Stdlib\ArrayObject::setIteratorClass()

Sets the iterator classname for the ArrayObject

Parameters

string $class:

Return value

void

2 calls to ArrayObject::setIteratorClass()
ArrayObject::unserialize in vendor/zendframework/zend-stdlib/src/ArrayObject.php
Unserialize an ArrayObject
ArrayObject::__construct in vendor/zendframework/zend-stdlib/src/ArrayObject.php
Constructor

File

vendor/zendframework/zend-stdlib/src/ArrayObject.php, line 353

Class

ArrayObject
Custom framework ArrayObject implementation

Namespace

Zend\Stdlib

Code

public function setIteratorClass($class) {
  if (class_exists($class)) {
    $this->iteratorClass = $class;
    return;
  }
  if (strpos($class, '\\') === 0) {
    $class = '\\' . $class;
    if (class_exists($class)) {
      $this->iteratorClass = $class;
      return;
    }
  }
  throw new Exception\InvalidArgumentException('The iterator class does not exist');
}