You are here

public function AbstractCallback::setOptions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php \Zend\Feed\PubSubHubbub\AbstractCallback::setOptions()

Process any injected configuration options

Parameters

array|Traversable $options Options array or Traversable object:

Return value

AbstractCallback

Throws

Exception\InvalidArgumentException

1 call to AbstractCallback::setOptions()
AbstractCallback::__construct in vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php
Constructor; accepts an array or Traversable object to preset options for the Subscriber without calling all supported setter methods in turn.

File

vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php, line 64

Class

AbstractCallback

Namespace

Zend\Feed\PubSubHubbub

Code

public function setOptions($options) {
  if ($options instanceof Traversable) {
    $options = ArrayUtils::iteratorToArray($options);
  }
  if (!is_array($options)) {
    throw new Exception\InvalidArgumentException('Array or Traversable object' . 'expected, got ' . gettype($options));
  }
  if (is_array($options)) {
    $this
      ->setOptions($options);
  }
  if (array_key_exists('storage', $options)) {
    $this
      ->setStorage($options['storage']);
  }
  return $this;
}