Results array of items from Collection or Arrayable.

@param callable|Closure|array|Traversable\Iterator|self|IteratorAggregate|JsonSerializable $items

@return array
974133
protected function getArrayableItems($items): array
    {
        if (is_array($items)) {
            return $items;
        } elseif (is_callable($items)) {
            return call_user_func($items);
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Iterator) {
            return $items;
        } elseif ($items instanceof Traversable) {
            return iterator_to_array($items);
        } elseif ($items instanceof IteratorAggregate) {
            return $items->getIterator();
        } elseif ($items instanceof JsonSerializable) {
            return $items->jsonSerialize();
        } elseif (method_exists($items, 'toJson')) {
            return json_decode($items->toJson(), true);
        } elseif (method_exists($items, 'toArray')) {
            return $items->toArray();
        }

        return (array) $items;
    }
590161
public function getDataByItems(array $items)
    {
        $output = [];
        foreach ($items as $item) {
            try {
                $output[] = $this->getDataByItem($item);
            } catch (ExtractorException $e) {
                \common_Logger::e('ERROR on item ' . $item->getUri() . ' : ' . $e->getMessage());
            }
        }

        if (empty($output)) {
            throw new ExtractorException('No data item to export.');
        }

        return $output;
    }
395025
public function Intersect( $items )
	{

		return $this
					->getClone()
					->setRepository( array_intersect( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );

	}
347861
private function loadModels(array $items)
    {
        $classes = [];
        $results = [];

        // Retrieve a list of keys to load from each class.
        foreach ($items as $item) {
            if (!is_null($item['key'])) {
                $classes[$item['class']][] = $item['key'];
            }
        }

        // Iterate list of classes and load all records matching a key.
        foreach ($classes as $class => $keys) {
            $model = new $class();
            $results[$class] = $model->whereIn($model->getKeyName(), $keys)->get()->keyBy($model->getKeyName());
        }

        return $results;
    }
789595
public function filter(array $items): array
    {
        $filtered = [];

        foreach ($items as $sectionName => $sectionDefinition) {
            $isExcluded = true;
            if ($this->shouldSectionBeAdded($sectionName, $sectionDefinition)) {
                $isExcluded = false;
            }
            $sectionDefinition[static::EXCLUDED] = $isExcluded;
            $filtered[$sectionName] = $sectionDefinition;
        }

        return $filtered;
    }
547923
public static function parameters(array $items)
    {
        $parameters = array();
        $items = array_filter(Arr::flatten($items));

        foreach ($items as $item) {
            $itemParams = $item->getParameters();

            if ($itemParams !== null) {
                $parameters []= $itemParams;
            }
        }

        return Arr::flatten($parameters);
    }
949270
public static function fromArray(array $items) : Interoperable
	{
		$obj = new static($items);
		foreach ($items as $key => $item) {
			$obj->__set($key, $item);
		}
		if (! empty($items['id'])) {
			$obj->setId($items[ 'id' ]);
		}
		return $obj;
	}
180595
public function toItems(array $objects): array
    {
        $items = [];
        foreach ($objects as $object) {
            $item = $this->toItem($object);
            if ($item instanceof Item) {
                $items[] = $item;
            }
        }

        return $items;
    }
447915
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->setImages($item);
        }

        return $items;
    }
1282008
private function buildCollectionModels(array $items)
    {
        $modelcollection = [];

        foreach ($items as $item) {
            $class = new \ReflectionClass("\\DirkGroenen\\Pinterest\\Models\\" . $this->model);
            $modelcollection[] = $class->newInstanceArgs([$this->master, $item]);
        }

        return $modelcollection;
    }
691990
public function createMany(array $items)
    {
        $models = collection();

        foreach ($items as $item) {
            $models[] = $this->create($item);
        }

        return $models;
    }
834349
public static function getArrayableItems($items)
    {
        if ($items instanceof ManagesItemsTrait || $items instanceof ManagesItemsInterface) {
            return $items->getAll();

        } elseif ($items instanceof Traversable) {
            return iterator_to_array($items);
        }

        return (array)$items;
    }
255448
protected function getArrayableItems($items)
	{
		if ($items instanceof Collection)
		{
			$items = $items->all();
		}
		elseif ($items instanceof Arrayable)
		{
			$items = $items->toArray();
		}

		return $items;
	}
278104
public static function order($items) {
		if (empty($items)) {
			return array();
		}

		$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
		asort($_items);

		foreach (array_keys($_items) as $key) {
			$_items[$key] = $items[$key];
		}

		return $items;
	}
480447
public function getTickets($items)
  {
    if (!count($items)) {
      return [];
    }

    $result = [];
    foreach ($items as $item) {
      $result[] = new Ticket($item);
    }

    return $result;
  }
1137458
public function setItems($items)
    {
        $orderItems = [];
        foreach ($items as $item) {
            if (is_array($item)) {
                $orderItems[] = new Item($item);
            } elseif (! ($item instanceof Item)) {
                throw new \InvalidArgumentException('Item should be an instance of ' . Item::class);
            }
        }

        return parent::setItems($orderItems);
    }
943566
public static function prepareItems($items)
    {
        if (!is_array($items)) {
            throw new InvalidConfigException(Yii::t('app', 'List items should be an array.'));
        }
        if (isset($items['class']) && isset($items['method'])) {
            return call_user_func([$items['class'], $items['method']]);
        } else {
            return $items;
        }
    }