Results array of items from Collection or Arrayable.

@param  mixed  $items
@return array
762889
protected function getItems( $items )
	{
		if (is_array($items))
		{
			return $items;
		}
		if($items instanceof self)
		{
			return $items->getAll();
		}
		if($items instanceof Arrayable)
		{
			return $items->toArray();
		}
		if($items instanceof Jsonable)
		{
			return json_decode($items->toJson(), true);
		}
		if($items instanceof JsonSerializable)
		{
			return $items->jsonSerialize();
		}
		if($items instanceof Traversable)
		{
			return iterator_to_array($items);
		}

		return (array) $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;
    }
172618
protected function getItems($items)
    {
        if (\is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Traversable) {
            return \iterator_to_array($items);
        }
        return (array) $items;
    }
317460
public function filter(array $items): array
    {
        $filtered = [];
        foreach ($items as $commandName => $commandDefinition) {
            if ($commandName === static::EXCLUDED) {
                continue;
            }

            $isExcluded = true;

            if ($this->shouldCommandBeAdded($commandName, $commandDefinition)) {
                $isExcluded = false;
            }

            $commandDefinition[static::EXCLUDED] = $isExcluded;
            $filtered[$commandName] = $commandDefinition;
        }

        return $filtered;
    }
136069
public function getOrderedArray($items = [])
    {
        $ordered = [];
        if (empty($items)) {
            $items = $this->_menuItems;
        }

        foreach ($items as $item) {
            $ordered[] = $item;
        }

        $ordered = Hash::sort($ordered, '{n}.priority', 'ASC');

        foreach ($ordered as &$item) {
            if (isset($item['children']) && !empty($item['children'])) {
                $item['children'] = $this->getOrderedArray($item['children']);
            }
        }

        return $ordered;
    }
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;
    }
296355
public function items(array $keys = null): array
    {
        if ($keys != null) {
            $return = [];
            foreach ($keys as $key) {
                $return[$key] = $this->get($key);
            }
        } else {
            $return = $this->data;
        }

        return $return;
    }
270341
public static function indexBy($items, $key)
    {
        $array = array();

        foreach ($items as $item) {
            $array[self::getValue($item, $key)] = $item;
        }

        return $array;
    }
1016770
public function fromItems(array $items): array
    {
        $objects = [];
        foreach ($items as $item) {
            $objects[] = $this->fromItem($item);
        }

        return $objects;
    }
990029
protected function map( array $items )
	{
		$list = [];

		foreach( $items as $item ) {
			$list[$item->getCode()] = $item;
		}

		return $list;
	}
76127
public static function collect($items, $key)
    {
        $array = array();

        foreach ($items as $v) {
            if (is_array($key)) {
                foreach ($key as $index => $k) {
                    if (!isset($array[$k])) {
                        $array[$k] = array();
                    }
                    $array[$k][] = self::getValue($v, $k);
                }
            } else {
                $array[] = self::getValue($v, $key);
            }
        }

        return $array;
    }
482907
public function items($items)
    {
        $items = !is_array($items) ? $items->all() : $items;
        $this->message['items'] = $items;
        return $this;
    }
8227
public function filter(array $items): array
    {
        foreach ($this->filter as $filter) {
            $items = $filter->filter($items);
        }

        return $items;
    }
205507
public static function toCollections(array $items): array
    {
        foreach ($items as $k => $item) {
            $items[$k] = new static($item);
        }

        return $items;
    }
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;
	}
1002130
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->doClean($item);
        }

        return $items;
    }
1087054
protected function isArrayable($items)
    {
        return is_array($items) ||
            $items instanceof self ||
            $items instanceof Arrayable ||
            $items instanceof Jsonable ||
            $items instanceof JsonSerializable ||
            $items instanceof Traversable;
    }