/** * {@inheritdoc} */ public function getInventoryName() { return $this->stockable->getInventoryName(); }
/** * @param StockableInterface $stockable * @param int $quantity */ public function __construct(StockableInterface $stockable, $quantity) { $this->stockable = $stockable; parent::__construct(sprintf('Only %d %s(s) on hand, %d requested.', $stockable->getOnHand(), $stockable->getInventoryName(), $quantity)); }