public function setCollections($collections)
{
if (!is_array($collections) && !$collections instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf('%s: expects an array or Traversable, received "%s"', __METHOD__, is_object($collections) ? get_class($collections) : gettype($collections)));
}
if ($collections instanceof Traversable) {
$collections = ArrayUtils::iteratorToArray($collections);
}
$this->collections = $collections;
}