You are here

interface StateTransitionFormInterface in State Machine 8

Defines the interface for state transition forms.

Used for applying a transition to the form entity's state field.

Hierarchy

Expanded class hierarchy of StateTransitionFormInterface

All classes that implement StateTransitionFormInterface

File

src/Form/StateTransitionFormInterface.php, line 13

Namespace

Drupal\state_machine\Form
View source
interface StateTransitionFormInterface extends BaseFormIdInterface {

  /**
   * Gets the form entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The form entity.
   */
  public function getEntity();

  /**
   * Sets the form entity.
   *
   * When the form is submitted, a transition will be applied to the entity,
   * and the entity will be saved.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The form entity.
   *
   * @return $this
   */
  public function setEntity(ContentEntityInterface $entity);

  /**
   * Gets the state field name.
   *
   * @return string
   *   The state field name.
   */
  public function getFieldName();

  /**
   * Sets the state field name.
   *
   * @param string $field_name
   *   The state field name.
   *
   * @return $this
   */
  public function setFieldName($field_name);

}

Members

Namesort descending Modifiers Type Description Overrides
BaseFormIdInterface::getBaseFormId public function Returns a string identifying the base form. 5
FormInterface::buildForm public function Form constructor. 179
FormInterface::getFormId public function Returns a unique string identifying the form. 236
FormInterface::submitForm public function Form submission handler. 192
FormInterface::validateForm public function Form validation handler. 30
StateTransitionFormInterface::getEntity public function Gets the form entity. 1
StateTransitionFormInterface::getFieldName public function Gets the state field name. 1
StateTransitionFormInterface::setEntity public function Sets the form entity. 1
StateTransitionFormInterface::setFieldName public function Sets the state field name. 1