* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Domain\Order\Payment\ValueObject; use PrestaShop\PrestaShop\Core\Domain\Order\Payment\Exception\PaymentException; /** * Order payment identity */ class OrderPaymentId { /** * @var int */ private $orderPaymentId; /** * @param int $orderPaymentId */ public function __construct($orderPaymentId) { if (!is_int($orderPaymentId) || 0 >= $orderPaymentId) { throw new PaymentException('Invalid order payment id supplied.'); } $this->orderPaymentId = $orderPaymentId; } /** * @return int */ public function getValue() { return $this->orderPaymentId; } }