Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Coupon.php
1
<?php
2
namespace
Bitrix\Main\UpdateSystem
;
3
4
class
Coupon
5
{
6
private
string
$coupon;
7
8
public
function
__construct
(
string
$coupon)
9
{
10
$this->coupon = $coupon;
11
}
12
13
public
function
isCoupone
(): bool
14
{
15
if
(!preg_match(
"#^[A-Z0-9]{3}-[A-Z]{2}-?[A-Z0-9]{12,30}$#i"
, $this->coupon)
16
&& !preg_match(
"#^[A-Z0-9]{3}-[A-Z0-9]{10}-[A-Z0-9]{10}$#i"
, $this->coupon))
17
{
18
return
false
;
19
}
20
21
return
true
;
22
}
23
24
public
function
getKey
(): string
25
{
26
return
$this->coupon;
27
}
28
}
Bitrix\Main\UpdateSystem\Coupon
Definition
Coupon.php:5
Bitrix\Main\UpdateSystem\Coupon\isCoupone
isCoupone()
Definition
Coupon.php:13
Bitrix\Main\UpdateSystem\Coupon\__construct
__construct(string $coupon)
Definition
Coupon.php:8
Bitrix\Main\UpdateSystem\Coupon\getKey
getKey()
Definition
Coupon.php:24
Bitrix\Main\UpdateSystem
Definition
ActivationSystem.php:1
modules
main
lib
UpdateSystem
Coupon.php
Создано системой
1.10.0