You are here

public function ClassMethods::setOptions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-hydrator/src/ClassMethods.php \Zend\Hydrator\ClassMethods::setOptions()

Parameters

array|Traversable $options:

Return value

ClassMethods

Throws

Exception\InvalidArgumentException

Overrides HydratorOptionsInterface::setOptions

File

vendor/zendframework/zend-hydrator/src/ClassMethods.php, line 71

Class

ClassMethods

Namespace

Zend\Hydrator

Code

public function setOptions($options) {
  if ($options instanceof Traversable) {
    $options = ArrayUtils::iteratorToArray($options);
  }
  elseif (!is_array($options)) {
    throw new Exception\InvalidArgumentException('The options parameter must be an array or a Traversable');
  }
  if (isset($options['underscoreSeparatedKeys'])) {
    $this
      ->setUnderscoreSeparatedKeys($options['underscoreSeparatedKeys']);
  }
  return $this;
}