Outlet::getRuleList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace alekciy\ofd\providers\taxcom\Model;
4
5
use alekciy\ofd\BaseModel;
6
use alekciy\ofd\interfaces\OutletInterface;
7
use alekciy\ofd\providers\taxcom\Status;
8
9
/**
10
 * Детальная информация по торговой точке
11
 */
12
class Outlet extends BaseModel implements OutletInterface
13
{
14
	/** @var string Адрес торговой точки */
15
	public $address = '';
16
17
	/** @var integer Количество ККТ */
18
	public $cashDeskCount = 0;
19
20
	/** @var string Код торговой точки */
21
	public $code = '';
22
23
	/** @var string Идентификатор торговой точки */
24
	public $id = '';
25
26
	/** @var string Название торговой точки */
27
	public $name = '';
28
29
	/** @var string Признак наличия проблемы */
30
	public $problemIndicator = '';
31
32
	/**
33
	 * @inheritDoc
34
	 */
35
	public function getRuleList(): array
36
	{
37
		return [
38
			'id'   => ['required', ['lengthMax', 36]],
39
			'name' => ['required', ['lengthMax', 255]],
40
41
			'code'             => [['lengthMax', 10]],
42
			'problemIndicator' => [['in', [
43
				Status::OK,
44
				Status::PROBLEM,
45
				Status::WARNING,
46
			]]],
47
		];
48
	}
49
50
	/**
51
	 * @inheritDoc
52
	 */
53
	public function getId(): string
54
	{
55
		return $this->id;
56
	}
57
58
	/**
59
	 * @inheritDoc
60
	 */
61
	public function getName(): string
62
	{
63
		return $this->name;
64
	}
65
66
	/**
67
	 * @inheritDoc
68
	 */
69
	public function getAddress(): string
70
	{
71
		return $this->address;
72
	}
73
74
	/**
75
	 * @inheritDoc
76
	 */
77
	protected function getPropertyInitMap(): array
78
	{
79
		return [];
80
	}
81
}