helper/ApiRestHelper/JsonHelper.php
public function array_fields($array, array $fields){
        $newArray= array();
        foreach ($array as $value) {
            $newValue= array();
            foreach ($fields as $key) {
                if(array_key_exists($key, $value)){
                    $newValue[$key]= $value[$key];
                }
            }
            $newArray[]= $newValue;
        }        
        return $newArray;
    }
public function array_fields($array, array $fields){
        $newArray= array();
        foreach ($array as $value) {
            $newValue= array();
            foreach ($fields as $key) {
                if(array_key_exists($key, $value)){
                    $newValue[$key]= $value[$key];
                }
            }
            $newArray[]= $newValue;
        }        
        return $newArray;
    }
public function array_fields ( $ array , array $ fields ) { $ newArray = array ( ) ; foreach ( $ array as $ value ) { $ newValue = array ( ) ; foreach ( $ fields as $ key ) { if ( array_key_exists ( $ key , $ value ) ) { $ newValue [ $ key ] = $ value [ $ key ] ; } } $ newArray [ ] = $ newValue ; } return $ newArray ; }
Retorna un array con los campos indicados
@param array $array
@param array $fields
@return array
Retorna un array con los campos indicados