* @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\SqlManagement\ValueObject; use PrestaShop\PrestaShop\Core\Domain\SqlManagement\Exception\SqlRequestException; /** * Class SqlRequestId is SqlRequest identifier. */ class SqlRequestId { /** * @var int */ private $value; /** * @param int $requestSqlId * * @throws SqlRequestException */ public function __construct($requestSqlId) { if (!is_int($requestSqlId) || $requestSqlId <= 0) { throw new SqlRequestException(sprintf('Invalid SqlRequest id: %s', var_export($requestSqlId, true))); } $this->value = (int) $requestSqlId; } /** * @return int */ public function getValue() { return $this->value; } }