protected function outputOne($data)
    {
        if (is_object($data)) {
            $data = $data->get();
        }
        if ($data['_id']) {
            $data = array('id' => (string) $data['_id']) + $data;
        }
        unset($data['_id']);

        foreach ($data as $key => $val) {
            if ($val instanceof MongoID) {
                $data[$key] = (string) $val;
            }
        }

        return $data;
    }
protected function outputOne($data)
    {
        if (is_object($data)) {
            $data = $data->get();
        }
        if ($data['_id']) {
            $data = array('id' => (string) $data['_id']) + $data;
        }
        unset($data['_id']);

        foreach ($data as $key => $val) {
            if ($val instanceof MongoID) {
                $data[$key] = (string) $val;
            }
        }

        return $data;
    }
protected function outputOne ( $ data ) { if ( is_object ( $ data ) ) { $ data = $ data -> get ( ) ; } if ( $ data [ '_id' ] ) { $ data = array ( 'id' => ( string ) $ data [ '_id' ] ) + $ data ; } unset ( $ data [ '_id' ] ) ; foreach ( $ data as $ key => $ val ) { if ( $ val instanceof MongoID ) { $ data [ $ key ] = ( string ) $ val ; } } return $ data ; }
Generic method for returning single record item of data, which can be
used for filtering or cleaning up.

@param object|array $data

@return array
Generic method for returning single record item of data which can be used for filtering or cleaning up .