1 | <?php |
||
13 | class ItemId extends EntityId implements Int32EntityId { |
||
14 | |||
15 | /** |
||
16 | * @since 0.5 |
||
17 | */ |
||
18 | const PATTERN = '/^Q[1-9]\d{0,9}\z/i'; |
||
19 | |||
20 | /** |
||
21 | * @param string $idSerialization |
||
22 | 33 | * |
|
23 | 33 | * @throws InvalidArgumentException |
|
24 | 16 | */ |
|
25 | 16 | public function __construct( $idSerialization ) { |
|
29 | 2 | ||
30 | private function assertValidIdFormat( $idSerialization ) { |
||
46 | |||
47 | 1 | /** |
|
48 | 1 | * @return int |
|
49 | */ |
||
50 | public function getNumericId() { |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | 1 | */ |
|
57 | 1 | public function getEntityType() { |
|
60 | |||
61 | /** |
||
62 | * @see Serializable::serialize |
||
63 | * |
||
64 | * @return string |
||
65 | 1 | */ |
|
66 | 1 | public function serialize() { |
|
69 | |||
70 | /** |
||
71 | * @see Serializable::unserialize |
||
72 | * |
||
73 | * @param string $serialized |
||
74 | */ |
||
75 | public function unserialize( $serialized ) { |
||
78 | |||
79 | /** |
||
80 | * Construct an ItemId given the numeric part of its serialization. |
||
81 | 9 | * |
|
82 | 9 | * CAUTION: new usages of this method are discouraged. Typically you |
|
83 | 1 | * should avoid dealing with just the numeric part, and use the whole |
|
84 | * serialization. Not doing so in new code requires special justification. |
||
85 | * |
||
86 | 8 | * @param int|float|string $numericId |
|
87 | * |
||
88 | * @return self |
||
89 | * @throws InvalidArgumentException |
||
90 | */ |
||
91 | public static function newFromNumber( $numericId ) { |
||
98 | |||
99 | } |
||
100 |