|
1
|
|
|
<?php |
|
2
|
|
|
namespace AlgoWeb\xsdTypes; |
|
3
|
|
|
|
|
4
|
|
|
use AlgoWeb\xsdTypes\Facets\EnumerationTrait; |
|
5
|
|
|
use AlgoWeb\xsdTypes\Facets\LengthTrait; |
|
6
|
|
|
use AlgoWeb\xsdTypes\Facets\PatternTrait; |
|
7
|
|
|
use AlgoWeb\xsdTypes\Facets\WhiteSpaceTrait; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* The type xsd:anySimpleType is the base type from which all other built-in types are derived. |
|
11
|
|
|
* Any value (including an empty value) is allowed for xsd:anySimpleType. |
|
12
|
|
|
* handles facets enumeration, length, maxLength, minLength, pattern |
|
13
|
|
|
* |
|
14
|
|
|
* @package AlgoWeb\xsdTypes |
|
15
|
|
|
*/ |
|
16
|
|
|
abstract class xsAnySimpleType |
|
17
|
|
|
{ |
|
18
|
|
|
use WhiteSpaceTrait, PatternTrait, EnumerationTrait, LengthTrait; |
|
19
|
|
|
/** |
|
20
|
|
|
* @Exclude |
|
21
|
|
|
* @var boolean indicates if the object is still initializing.d |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $initializing = false; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @property mixed $__value |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $__value = null; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Construct |
|
32
|
|
|
* |
|
33
|
|
|
* @param mixed $value |
|
34
|
|
|
*/ |
|
35
|
|
|
public function __construct($value) |
|
36
|
|
|
{ |
|
37
|
|
|
$this->__value = $value; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
protected function fixValue() |
|
41
|
|
|
{ |
|
42
|
|
|
$this->__value = $this->fixWhitespace($this->__value); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
protected function isOKInternal() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->checkEnumeration($this->__value); |
|
48
|
|
|
$this->checkMaxLength($this->__value); |
|
49
|
|
|
$this->checkMinLength($this->__value); |
|
50
|
|
|
$this->checkPattern($this->__value); |
|
51
|
|
|
return $this->isOK(); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
abstract protected function isOK(); |
|
56
|
|
|
} |
|
57
|
|
|
|