original_string: public function jsonSerialize()
      {
          if (! Norm::options('include')) {
              return $this->toArray();
          }
  
          $destination = array();
          $source =  $this->toArray();
  
          $schema = $this->collection->schema();
  
          foreach ($source as $key => $value) {
              if (isset($schema[$key]) and isset($value)) {
                  $destination[$key] = $schema[$key]->toJSON($value);
              } else {
                  $destination[$key] = $value;
              }
  
              $destination[$key] = JsonKit::replaceObject($destination[$key]);
          }
  
          return $destination;
      }
code: public function jsonSerialize()
      {
          if (! Norm::options('include')) {
              return $this->toArray();
          }
  
          $destination = array();
          $source =  $this->toArray();
  
          $schema = $this->collection->schema();
  
          foreach ($source as $key => $value) {
              if (isset($schema[$key]) and isset($value)) {
                  $destination[$key] = $schema[$key]->toJSON($value);
              } else {
                  $destination[$key] = $value;
              }
  
              $destination[$key] = JsonKit::replaceObject($destination[$key]);
          }
  
          return $destination;
      }
code_tokens: public function jsonSerialize ( ) { if ( ! Norm :: options ( 'include' ) ) { return $ this -> toArray ( ) ; } $ destination = array ( ) ; $ source = $ this -> toArray ( ) ; $ schema = $ this -> collection -> schema ( ) ; foreach ( $ source as $ key => $ value ) { if ( isset ( $ schema [ $ key ] ) and isset ( $ value ) ) { $ destination [ $ key ] = $ schema [ $ key ] -> toJSON ( $ value ) ; } else { $ destination [ $ key ] = $ value ; } $ destination [ $ key ] = JsonKit :: replaceObject ( $ destination [ $ key ] ) ; } return $ destination ; }
docstring: Implement the json serializer normalizing the data structures.
  
  @return array
docstring_tokens: Implement the json serializer normalizing the data structures .