You are here

class MenuEntityCloneForm in Entity Clone 8

Class MenuEntityCloneForm.

Hierarchy

Expanded class hierarchy of MenuEntityCloneForm

1 file declares its use of MenuEntityCloneForm
entity_clone.module in ./entity_clone.module
Contains entity_clone.module.

File

src/EntityClone/Config/MenuEntityCloneForm.php, line 10

Namespace

Drupal\entity_clone\EntityClone\Config
View source
class MenuEntityCloneForm extends ConfigEntityCloneFormBase {

  /**
   * {@inheritdoc}
   */
  public function formElement(EntityInterface $entity, $parent = TRUE) {
    $form = parent::formElement($entity, $parent);

    // Menu entities require special replace pattern.
    $form['id']['#machine_name'] += [
      'replace_pattern' => '[^a-z0-9-]+',
      'replace' => '-',
    ];
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityCloneFormBase::$entityTypeManager protected property The entity type manager.
ConfigEntityCloneFormBase::$translationManager protected property The string translation.
ConfigEntityCloneFormBase::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance
ConfigEntityCloneFormBase::getValues public function Get all new values provided by the specific form element. Overrides EntityCloneFormInterface::getValues
ConfigEntityCloneFormBase::__construct public function Constructs a new ConfigEntityCloneFormBase.
MenuEntityCloneForm::formElement public function Get all specific form element. Overrides ConfigEntityCloneFormBase::formElement