interface AddToCartFormInterface in Commerce Core 8.2
Provides the add to cart form interface.
Extends the regular interface to allow the form ID to be overriden. By default the form ID is suffixed with the order item's purchasable entity ID, to achieve uniqueness. Callers can replace that form ID with a more stable one, or to handle the case where the order item has no purchasable entity, but multiple form instances are still desired.
Hierarchy
- interface \Drupal\Core\Form\FormInterface
- interface \Drupal\Core\Form\BaseFormIdInterface
- interface \Drupal\Core\Entity\EntityFormInterface
- interface \Drupal\Core\Entity\ContentEntityFormInterface
- interface \Drupal\commerce_cart\Form\AddToCartFormInterface
- interface \Drupal\Core\Entity\ContentEntityFormInterface
- interface \Drupal\Core\Entity\EntityFormInterface
- interface \Drupal\Core\Form\BaseFormIdInterface
Expanded class hierarchy of AddToCartFormInterface
All classes that implement AddToCartFormInterface
File
- modules/
cart/ src/ Form/ AddToCartFormInterface.php, line 16
Namespace
Drupal\commerce_cart\FormView source
interface AddToCartFormInterface extends ContentEntityFormInterface {
/**
* Sets the form ID.
*
* @param string $form_id
* The form ID.
*
* @return $this
*/
public function setFormId($form_id);
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddToCartFormInterface:: |
public | function | Sets the form ID. | 1 |
BaseFormIdInterface:: |
public | function | Returns a string identifying the base form. | 5 |
ContentEntityFormInterface:: |
public | function | Gets the form display. | 1 |
ContentEntityFormInterface:: |
public | function | Gets the code identifying the active form language. | 1 |
ContentEntityFormInterface:: |
public | function | Checks whether the current form language matches the entity one. | 1 |
ContentEntityFormInterface:: |
public | function | Sets the form display. | 1 |
ContentEntityFormInterface:: |
public | function |
Note that extending classes should not override this method to add entity
validation logic, but define further validation constraints using the
entity validation API and/or provide a new validation constraint if
necessary. This is the only way to… Overrides FormInterface:: |
|
EntityFormInterface:: |
public | function | Builds an updated entity object based upon the submitted form values. | 1 |
EntityFormInterface:: |
public | function | Gets the form entity. | 1 |
EntityFormInterface:: |
public | function | Determines which entity will be used by this form from a RouteMatch object. | 1 |
EntityFormInterface:: |
public | function | Gets the operation identifying the form. | 1 |
EntityFormInterface:: |
public | function | Form submission handler for the 'save' action. | 1 |
EntityFormInterface:: |
public | function | Sets the form entity. | 1 |
EntityFormInterface:: |
public | function | Sets the entity manager for this form. | 1 |
EntityFormInterface:: |
public | function | Sets the entity type manager for this form. | 1 |
EntityFormInterface:: |
public | function | Sets the module handler for this form. | 1 |
EntityFormInterface:: |
public | function | Sets the operation for this form. | 1 |
EntityFormInterface:: |
public | function | Sets the string translation service for this form. | |
FormInterface:: |
public | function | Form constructor. | 179 |
FormInterface:: |
public | function | Returns a unique string identifying the form. | 236 |
FormInterface:: |
public | function | Form submission handler. | 192 |