1 | <?php |
||
18 | class EntityIdValue extends DataValueObject { |
||
19 | |||
20 | private $entityId; |
||
21 | 19 | ||
22 | 19 | public function __construct( EntityId $entityId ) { |
|
25 | |||
26 | /** |
||
27 | * @see Serializable::serialize |
||
28 | * |
||
29 | * @since 7.0 serialization format changed in an incompatible way |
||
30 | * |
||
31 | * @note Do not use PHP serialization for persistence! Use a DataValueSerializer instead. |
||
32 | 8 | * |
|
33 | 8 | * |
|
34 | 8 | * @return string |
|
35 | 8 | */ |
|
36 | 8 | public function serialize() { |
|
39 | |||
40 | /** |
||
41 | * @see Serializable::unserialize |
||
42 | * |
||
43 | * @since 0.5 |
||
44 | * |
||
45 | * @param string $serialized |
||
46 | * |
||
47 | 16 | * @throws IllegalValueException |
|
48 | 16 | */ |
|
49 | public function unserialize( $serialized ) { |
||
67 | |||
68 | /** |
||
69 | 8 | * @see DataValue::getType |
|
70 | 8 | * |
|
71 | * @since 0.5 |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public static function getType() { |
||
78 | |||
79 | 7 | /** |
|
80 | 7 | * @see DataValue::getSortKey |
|
81 | * |
||
82 | * @since 0.5 |
||
83 | * |
||
84 | * @return string|float|int |
||
85 | */ |
||
86 | public function getSortKey() { |
||
89 | |||
90 | 7 | /** |
|
91 | 7 | * @see DataValue::getValue |
|
92 | * |
||
93 | * @since 0.5 |
||
94 | * |
||
95 | * @return self |
||
96 | */ |
||
97 | public function getValue() { |
||
100 | |||
101 | 7 | /** |
|
102 | 7 | * @since 0.5 |
|
103 | * |
||
104 | * @return EntityId |
||
105 | */ |
||
106 | public function getEntityId() { |
||
109 | |||
110 | 1 | /** |
|
111 | 1 | * @see DataValue::getArrayValue |
|
112 | * |
||
113 | * @since 0.5 |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | public function getArrayValue() { |
||
129 | |||
130 | /** |
||
131 | * Constructs a new instance of the DataValue from the provided data. |
||
132 | * This can round-trip with |
||
133 | * @see getArrayValue |
||
134 | * |
||
135 | * @since 0.5 |
||
136 | * |
||
137 | * @param mixed $data |
||
138 | * |
||
139 | * @deprecated since 7.1, use callbacks in DataValueDeserializer instead |
||
140 | 17 | * |
|
141 | 17 | * @throws IllegalValueException |
|
142 | 2 | * @return self |
|
143 | */ |
||
144 | public static function newFromArray( $data ) { |
||
159 | 4 | ||
160 | /** |
||
161 | * @param string $entityType |
||
162 | 8 | * @param int|float|string $numericId |
|
163 | * |
||
164 | * @throws IllegalValueException |
||
165 | * @return self |
||
166 | */ |
||
167 | private static function newIdFromTypeAndNumber( $entityType, $numericId ) { |
||
174 | |||
175 | } |
||
176 |