code: public function updateEntryName(ContentfulEntry $entry)
      {
          $displayField = $this->getDisplayField();
          $values       = array_values((array)$entry->{$displayField});
          $entry->setName(isset($values[0]) ? $values[0] : 'Untitled');
      }
docs: Updates the name according to the display field of the content type.
  
  @param ContentfulEntry $entry