1 | <?php |
||
31 | class ModelAbstract extends \stdClass |
||
32 | { |
||
33 | const CONTEXT = ''; |
||
34 | |||
35 | /** |
||
36 | * ModelAbstract constructor. |
||
37 | * |
||
38 | * @param \stdClass|null $oData |
||
39 | * @param \stdClass|null $oLayers |
||
40 | */ |
||
41 | 6 | public function __construct(\stdClass $oData = null, \stdClass $oLayers = null) |
|
58 | |||
59 | /** |
||
60 | * Cleaning telephone number |
||
61 | * |
||
62 | * @param $nr |
||
63 | * |
||
64 | * @return string|null |
||
65 | */ |
||
66 | 2 | protected function cleanTelephoneNr($nr) |
|
67 | { |
||
68 | 2 | if (!empty($value)) { |
|
69 | $nr = preg_replace('/[^0-9]/', '', strval($nr)); |
||
70 | |||
71 | //removing zeros only for national numbers (only single zero at the beginning) |
||
72 | return preg_replace('/^0(?=([1-9]+[0-9]*))/', '', $nr); |
||
73 | } |
||
74 | |||
75 | 2 | return null; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * Convert string to integer |
||
80 | * |
||
81 | * @param string $value |
||
82 | * |
||
83 | * @return int|null |
||
84 | */ |
||
85 | 6 | protected function convertToId($value) |
|
89 | |||
90 | /** |
||
91 | * Remove namesoace class from the property name |
||
92 | * |
||
93 | * @param string $property |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | 6 | protected function stripProperty(string $property) |
|
101 | |||
102 | } |
||
103 |