original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Generic method for returning single record item of data, which can be
  used for filtering or cleaning up.
  
  @param object|array $data
  
  @return array
docstring_tokens: Generic method for returning single record item of data which can be used for filtering or cleaning up .