public function toArray($recursive = true)
    {
        $results     = [];
        $collections = $this->collections;

        if ($recursive) {
            foreach ($collections as $key => $value) {
                if ($value instanceof CollectionInterface) {
                    /** @noinspection PhpMethodParametersCountMismatchInspection */
                    $results[$key] = $value->toArray($recursive);
                } else {
                    $results[$key] = $value;
                }
            }
        } else {
            foreach ($collections as $key => $value) {
                $results[$key] = $value;
            }
        }

        return $results;
    }
public function toArray($recursive = true)
    {
        $results     = [];
        $collections = $this->collections;

        if ($recursive) {
            foreach ($collections as $key => $value) {
                if ($value instanceof CollectionInterface) {
                    /** @noinspection PhpMethodParametersCountMismatchInspection */
                    $results[$key] = $value->toArray($recursive);
                } else {
                    $results[$key] = $value;
                }
            }
        } else {
            foreach ($collections as $key => $value) {
                $results[$key] = $value;
            }
        }

        return $results;
    }
public function toArray ( $ recursive = true ) { $ results = [ ] ; $ collections = $ this -> collections ; if ( $ recursive ) { foreach ( $ collections as $ key => $ value ) { if ( $ value instanceof CollectionInterface ) { /** @noinspection PhpMethodParametersCountMismatchInspection */ $ results [ $ key ] = $ value -> toArray ( $ recursive ) ; } else { $ results [ $ key ] = $ value ; } } } else { foreach ( $ collections as $ key => $ value ) { $ results [ $ key ] = $ value ; } } return $ results ; }
Get the array representation of this object.

@param bool $recursive

@return array
Get the array representation of this object .