original_string: protected function getEmbedData(DataObject $record, $relationName)
      {
          if ($record->hasMethod($relationName)) {
              $relationData = $record->$relationName();
              if ($relationData instanceof RelationList) {
                  return $this->formatDataList($relationData);
              } else {
                  return $this->formatDataObject($relationData);
              }
          }
  
          return null;
      }
code: protected function getEmbedData(DataObject $record, $relationName)
      {
          if ($record->hasMethod($relationName)) {
              $relationData = $record->$relationName();
              if ($relationData instanceof RelationList) {
                  return $this->formatDataList($relationData);
              } else {
                  return $this->formatDataObject($relationData);
              }
          }
  
          return null;
      }
code_tokens: protected function getEmbedData ( DataObject $ record , $ relationName ) { if ( $ record -> hasMethod ( $ relationName ) ) { $ relationData = $ record -> $ relationName ( ) ; if ( $ relationData instanceof RelationList ) { return $ this -> formatDataList ( $ relationData ) ; } else { return $ this -> formatDataObject ( $ relationData ) ; } } return null ; }
docstring: Returns a DataObject relation's data formatted and ready to embed.
  
  @param  DataObject $record       The DataObject to get the data from
  @param  string     $relationName The name of the relation
  @return array|null               Formatted DataObject or RelationList ready to embed or null if nothing to embed
docstring_tokens: Returns a DataObject relation s data formatted and ready to embed .