protected function EntityFormController::actions

Returns an array of supported actions for the current entity form.

8 calls to EntityFormController::actions()
10 methods override EntityFormController::actions()

File

drupal/core/lib/Drupal/Core/Entity/EntityFormController.php, line 128
Definition of Drupal\Core\Entity\EntityFormController.

Class

EntityFormController
Base class for entity form controllers.

Namespace

Drupal\Core\Entity

Code

protected function actions(array $form, array &$form_state) {
  return array(
    // @todo Rename the action key from submit to save.
    'submit' => array(
      '#value' => t('Save'),
      '#validate' => array(
        array(
          $this,
          'validate',
        ),
      ),
      '#submit' => array(
        array(
          $this,
          'submit',
        ),
        array(
          $this,
          'save',
        ),
      ),
    ),
    'delete' => array(
      '#value' => t('Delete'),
      // No need to validate the form when deleting the entity.
      '#submit' => array(
        array(
          $this,
          'delete',
        ),
      ),
    ),
  );
}