You are here

public function HydratingIteratorIterator::setPrototype in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorIterator.php \Zend\Hydrator\Iterator\HydratingIteratorIterator::setPrototype()

@inheritdoc

Overrides HydratingIteratorInterface::setPrototype

1 call to HydratingIteratorIterator::setPrototype()
HydratingIteratorIterator::__construct in vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorIterator.php

File

vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorIterator.php, line 44

Class

HydratingIteratorIterator

Namespace

Zend\Hydrator\Iterator

Code

public function setPrototype($prototype) {
  if (is_object($prototype)) {
    $this->prototype = $prototype;
    return;
  }
  if (!class_exists($prototype)) {
    throw new InvalidArgumentException(sprintf('Method %s was passed an invalid class name: %s', __METHOD__, $prototype));
  }
  $this->prototype = new $prototype();
}