public function toArray()
    {
        $types = [];
        foreach ($this->collection as $type) {
            $types[$type->getName()] = $type->toArray();
        }

        return $types;
    }
public function toArray()
    {
        $types = [];
        foreach ($this->collection as $type) {
            $types[$type->getName()] = $type->toArray();
        }

        return $types;
    }
public function toArray ( ) { $ types = [ ] ; foreach ( $ this -> collection as $ type ) { $ types [ $ type -> getName ( ) ] = $ type -> toArray ( ) ; } return $ types ; }
Returns types in a plain multidimensional array

@return array Returns plain array.
Returns types in a plain multidimensional array