Return this list as an array and every object it as an sub array as well

@return array
181115
public function toNestedArray()
    {
        $result = [];

        foreach ($this->items as $item) {
            if (is_object($item)) {
                if (method_exists($item, 'toMap')) {
                    $result[] = $item->toMap();
                } else {
                    $result[] = (array) $item;
                }
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
1070622
public Object[] toArray() {
    Iterator<E> iter = iterator();
    ArrayList<Object> al = new ArrayList<Object>();
    while (iter.hasNext()) {
      al.add(iter.next());
    }
    return al.toArray();
  }
7021
public static function getArray()
    {
        $var = new Vars();
        $list = array();
        foreach ($var->get_all()->getModels() as $item) {
            $list[$item->key] = $item->value;
        }
        return $list;
    }
891644
public function toArray()
    {
        $arrRet = [];
        foreach ($this as $propName => $propValue) {
            if ($this->hasColumn($propName)) {
                $arrRet[$propName] = $propValue;
            }
        }

        return $arrRet;
    }
997872
public function toArray()
    {
        $result = array();
        foreach ($this as $key => $row) {
            $result[$key] = $row->toArray();
        }
        return $result;
    }
121756
public function toArray()
    {
        if ($this->gettersVariable) {
            $var = $this->gettersVariable;

            return $this->{$var};
        }

        $properties = (array)$this;
        $list = [];
        foreach ($properties as $property => $value) {
            if ($property[0] !== "\0") {
                $list[$property] = $value;
            }
        }

        return $list;
    }
674896
public function toArray()
	{
		$list	= array();
		foreach( $this->fields as $name => $fields )
			foreach( $fields as $field )
				$list[]	= $field->toString();
		return $list;
	}
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
533407
final public function toArray()
    {
        $this->checkRequiredFields();

        $fields = get_object_vars($this);

        $array = [];
        foreach ($fields as $field => $value) {
            $array[$field] = $this->transformToArray($this->getAttribute($field));
        }

        return $array;
    }
353284
public function toArray()
    {
        $result = array();
        if($row = $this->getIterator()->current()) {
            $result = $row->toArray();
        }

        return $result;
    }
383546
public function toArray()
    {
        $state = [
            $this->key,
            $this->current ? $this->current->copy() : null,
            $this->validationResult,
        ];

        $result = iterator_to_array($this);

        [
            $this->key,
            $this->current,
            $this->validationResult
        ] = $state;

        return $result;
    }
1359050
public function toArray()
    {
        $arrayConfig = [];
        foreach (get_object_vars($this) as $key => $value) {
            if (is_object($value)) {
                if (method_exists($value, 'toArray')) {
                    $arrayConfig[$key] = $value->toArray();
                } else {
                    $arrayConfig[$key] = $value;
                }
            } else {
                $arrayConfig[$key] = $value;
            }
        }
        return $arrayConfig;
    }
1139896
public function toArray()
    {
        $result = [];
        foreach ($this as $key => $value) {
            $result[$key] = $value;
        }
        return $result;
    }
187219
public function toArray()
    {
        $data = [];

        foreach ($this->keys() as $key) {
            $data[$key] = $this->offsetGet($key);
        }

        return $data;
    }
536058
public function toArray()
    {
        return [
            'name'                  => $this->name,
            'label'                 => $this->label,
            'description'           => $this->description,
            'class_name'            => $this->className,
            'singleton'             => $this->singleton,
            'read_only'             => $this->readOnly,
            'subscription_required' => $this->subscriptionRequired,
        ];
    }
700499
public function toFullArray(): array
    {
        //convert the obj to array in order to conver to json
        $result = get_object_vars($this);

        foreach ($result as $key => $value) {
            if (preg_match('#^_#', $key) === 1) {
                unset($result[$key]);
            }
        }

        return $result;
    }
1370103
public function toArray(): array
	{
		$results = [];

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

		return $results;
	}