コード例 #1
0
 /**
  * Returns an array of entity type labels to be included in the UI text.
  *
  * @return array
  *   Associative array with the following keys:
  *   - 'singular': The label for singular form.
  *   - 'plural': The label for plural form.
  */
 protected function labels()
 {
     // The admin has specified the exact labels that should be used.
     if ($this->getSetting('override_labels')) {
         return ['singular' => $this->getSetting('label_singular'), 'plural' => $this->getSetting('label_plural')];
     } else {
         $this->initializeIefController();
         return $this->iefHandler->labels();
     }
 }
コード例 #2
0
 /**
  * Gets the entity type managed by this handler.
  *
  * @return \Drupal\Core\Entity\EntityTypeInterface
  *   The entity type.
  */
 protected function getEntityTypeLabels()
 {
     // The admin has specified the exact labels that should be used.
     if ($this->getSetting('override_labels')) {
         return ['singular' => $this->getSetting('label_singular'), 'plural' => $this->getSetting('label_plural')];
     } else {
         $this->createInlineFormHandler();
         return $this->inlineFormHandler->getEntityTypeLabels();
     }
 }