src/ORM/ArrayLib.php
public static function flatten($array, $preserveKeys = true, &$out = array())
    {
        array_walk_recursive(
            $array,
            function ($value, $key) use (&$out, $preserveKeys) {
                if (!is_scalar($value)) {
                    // Do nothing
                } elseif ($preserveKeys) {
                    $out[$key] = $value;
                } else {
                    $out[] = $value;
                }
            }
        );

        return $out;
    }
public static function flatten($array, $preserveKeys = true, &$out = array())
    {
        array_walk_recursive(
            $array,
            function ($value, $key) use (&$out, $preserveKeys) {
                if (!is_scalar($value)) {
                    // Do nothing
                } elseif ($preserveKeys) {
                    $out[$key] = $value;
                } else {
                    $out[] = $value;
                }
            }
        );

        return $out;
    }
public static function flatten ( $ array , $ preserveKeys = true , & $ out = array ( ) ) { array_walk_recursive ( $ array , function ( $ value , $ key ) use ( & $ out , $ preserveKeys ) { if ( ! is_scalar ( $ value ) ) { // Do nothing } elseif ( $ preserveKeys ) { $ out [ $ key ] = $ value ; } else { $ out [ ] = $ value ; } } ) ; return $ out ; }
Takes an multi dimension array and returns the flattened version.

@param array $array
@param boolean $preserveKeys
@param array $out

@return array
Takes an multi dimension array and returns the flattened version .