
| Current Path : /var/www/html/store/web/modules/contrib/commerce/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/modules/contrib/commerce/src/AvailabilityManagerInterface.php |
<?php
namespace Drupal\commerce;
/**
* Runs the added checkers to determine the availability of a purchasable entity.
*
* If any checker returns FALSE, the entity is considered to be unavailable.
* Example checks:
* - Whether the entity is in stock.
* - Whether the entity's "available on" date is before the current date.
*
* @see \Drupal\commerce\AvailabilityCheckerInterface
*/
interface AvailabilityManagerInterface {
/**
* Adds a checker.
*
* @param \Drupal\commerce\AvailabilityCheckerInterface $checker
* The checker.
*/
public function addChecker(AvailabilityCheckerInterface $checker);
/**
* Gets all added checkers.
*
* @return \Drupal\commerce\AvailabilityCheckerInterface[]
* The checkers.
*/
public function getCheckers();
/**
* Checks the availability of the given purchasable entity.
*
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The purchasable entity.
* @param string $quantity
* The quantity.
* @param \Drupal\commerce\Context $context
* The context.
*
* @return bool
* TRUE if the purchasable entity is available, FALSE otherwise.
*/
public function check(PurchasableEntityInterface $entity, $quantity, Context $context);
}