public function toArray()
    {
        $array = array();
        $allowed = get_class_vars(get_class($this));
        foreach (get_object_vars($this) as $key => $item) {
            if (array_key_exists($key, $allowed) && isset($item)) {
                $array[constant(strtoupper("CURLOPT_" . $key))] = (method_exists($item, 'build') ? $item->build() : $item);
            }
        }
        return $array;
    }
public function toArray()
    {
        $array = array();
        $allowed = get_class_vars(get_class($this));
        foreach (get_object_vars($this) as $key => $item) {
            if (array_key_exists($key, $allowed) && isset($item)) {
                $array[constant(strtoupper("CURLOPT_" . $key))] = (method_exists($item, 'build') ? $item->build() : $item);
            }
        }
        return $array;
    }
public function toArray ( ) { $ array = array ( ) ; $ allowed = get_class_vars ( get_class ( $ this ) ) ; foreach ( get_object_vars ( $ this ) as $ key => $ item ) { if ( array_key_exists ( $ key , $ allowed ) && isset ( $ item ) ) { $ array [ constant ( strtoupper ( "CURLOPT_" . $ key ) ) ] = ( method_exists ( $ item , 'build' ) ? $ item -> build ( ) : $ item ) ; } } return $ array ; }
Transform the object to array.
@return array
Transform the object to array .