public function toArray()
    {
        $data = [];
        foreach ($this->items as $key => $value) {
            if ($value instanceof BaseObjectInterface) {
                $value = $value->toArray();
            }
            $data[$key] = $value;
        }

        return $data;
    }
public function toArray()
    {
        $data = [];
        foreach ($this->items as $key => $value) {
            if ($value instanceof BaseObjectInterface) {
                $value = $value->toArray();
            }
            $data[$key] = $value;
        }

        return $data;
    }
public function toArray ( ) { $ data = [ ] ; foreach ( $ this -> items as $ key => $ value ) { if ( $ value instanceof BaseObjectInterface ) { $ value = $ value -> toArray ( ) ; } $ data [ $ key ] = $ value ; } return $ data ; }
Returns the collection's underlying array.

@return array
Returns the collection s underlying array .