Get the collection of items as a plain array.

@return array
171844
public function toArray(): array
    {
        $generator = function (Iterator $data) {
            foreach ($data as $key => $item) {
                if ($item instanceof JsonSerializable) {
                    $item = $item->jsonSerialize();
                }
                yield $key => $item;
            }
        };

        return iterator_to_array($generator($this->generator));
    }
939682
public function getItems()
    {
        if (count($this->items) > $this->itemsPerPage) {
            $items = [];
            $counter = 0;
            foreach ($this->items as $key => $value) {
                $items[$key] = $value;
                $counter++;
                if ($counter == $this->itemsPerPage) {
                    return $items;
                }
            }
        }

        return $this->items;
    }
760348
public function getListItems()
    {
        $item_arr = [];
        foreach ($this->items as $item)
        {
            $item_arr[$item->id] = $item->title;
        }
        return $item_arr;
    }
125320
public function toArray(): array
    {
        $result = [];
        foreach (static::getInstanceProperties() as $key) {
            $result[$key] = $this->$key;
        }

        return $result;
    }
1192003
public function toArray()
    {
        return [
            'required'      => $this->isRequired(),
            'hidden'        => $this->isHidden(),
            'persistent'    => $this->isPersistent(),
            'whenReplicate' => $this->getWhenReplicate()->toArray(),
            'whenPatch'     => $this->getWhenPatch()->toArray(),
        ];
    }
786555
public function getItems()
	{
		/**
		 * @var array $res
		 */
		$res = array();
		foreach ( $this->iter as /** @var XPathItem $item */ $item )
		{
			if ( count( $res ) == 10)
				break;

			$res[] = $item->CloneInstance();
		}

		return $res;
	}
377932
public function getItems()
    {
        if (!is_array($this->items)) {
            $items = array();
            foreach ($this->data['items'] as $streamData) {
                $items[] = new Stream($streamData);
            }
            $this->items = $items;
        }
        return $this->items;
    }
1161453
public function toArray()
    {
        $attr = !empty($this->getWarden()) ? $this->getWarden() : null;
        if (empty($attr)) {
            $attr = empty($this->getVisible()) ? $this->getFillable() : $this->getVisible();
        }
        $returnable = [];

        $f_model = \FormModel::using('plain')->withModel($this);
        foreach ($attr as $old => $new) {
            if (!empty($relations = $f_model->getRelationalDataAndModels($this, $old))) {
                $returnable[$new] = $relations;
            }
            if (stripos($old, '_id') !== false) {
                if (!empty($this->$new)) {
                    $returnable[$new] = $relations;
                }
            } else {
                if (isset($this->$old)) {
                    $returnable[$new] = $this->$old;
                }
            }
        }

        return $returnable;
    }
434700
public function getAsArray() {
        $a = ['type'=>$this->type];
        switch ($this->type) {
            case ResponseSpeechSO::TYPE_PLAIN_TEXT:
                $a['text'] = $this->text;
                break;
            case ResponseSpeechSO::TYPE_SSML:
                $a['ssml'] = $this->ssml;
                break;
        }
        return $a;
    }
424028
public function getItems()
    {
        if ($this->_items !== null) {
            return $this->_items;
        }
        
        $data = [];
        foreach ($this->getModules() as $node) {
            foreach (ArrayHelper::getValue($this->getModuleItems($node['id']), 'groups', []) as $groupValue) {
                foreach ($groupValue['items'] as $array) {
                    $array['module'] = $node;
                    $data[] = $array;
                }
            }
        }

        $this->_items = $data;
        
        return $data;
    }
681122
public static function all(): array
    {
        $class = get_called_class();

        if (isset(self::$items[$class])) {
            return self::$items[$class];
        }

        $constants = static::constants();

        $items = [];

        foreach ($constants as $key => $value) {
            $items[$value] = new $class($key, $value);
        }

        return self::$items[$class] = $items;
    }
614683
public function toArray()
    {
        $items = array();
        foreach ($this->items as $key => $item) {
            if (is_numeric($item)) {
                $item = DataObject::get_by_id($this->dataClass, $item);
            }
            if (!empty($this->extraFields[$key])) {
                $item->update($this->extraFields[$key]);
            }
            $items[] = $item;
        }
        return $items;
    }
520313
public function toArray() : array
	{
		$items= is_array($this->items)? $this->items : [];
		foreach ($items as $itemIndex => $item) {
			if (is_object($item)&& is_callable([$item,'toArray'])) {
				try {
					$items[ $itemIndex ] = $item->toArray();
				} catch (\Exception $e) {
					throw $e;
				}
			}
		}
		return $items;
	}
759466
public function toArray()
	{
		$response = array();

		foreach ($this->items as $key => $item)
		{
			$response[] = $item->toArray();
		}

		return $response;
	}
524370
public function toArray()
        {
            $array = array();
            $data = $this->_data;
            foreach ($data as $key => $value) {
                if ($value instanceof Loadini) {
                    $array[$key] = $value->toArray();
                } else {
                    $array[$key] = $value;
                }
            }
            return $array;
        }
299478
public function toArray()
    {
        $articles   = [];
        foreach ($this->articles as $item)
        {
            $articles[] = $item->toArray();
        }

        $result = parent::toArray();
        $result['articles'] = $articles;

        return $result;
    }
726865
private function items(): array
    {
        $items = [];

        foreach ($this->samples as $sample) {
            foreach ($sample as $item) {
                if (!in_array($item, $items, true)) {
                    $items[] = $item;
                }
            }
        }

        return array_map(function ($entry) {
            return [$entry];
        }, $items);
    }