1 | <?php |
||
23 | abstract class SnakObject implements Snak, FacetContainer { |
||
24 | |||
25 | /** |
||
26 | * @var FacetManager|null |
||
27 | */ |
||
28 | private $facetManager = null; |
||
29 | |||
30 | /** |
||
31 | * @since 0.1 |
||
32 | * |
||
33 | * @var PropertyId |
||
34 | */ |
||
35 | protected $propertyId; |
||
36 | |||
37 | /** |
||
38 | * Support for passing in an EntityId instance that is not a PropertyId instance has |
||
39 | * been deprecated since 0.5. |
||
40 | * |
||
41 | * @since 0.1 |
||
42 | * |
||
43 | * @param PropertyId|EntityId|int $propertyId |
||
44 | * |
||
45 | * @throws InvalidArgumentException |
||
46 | */ |
||
47 | 40 | public function __construct( $propertyId ) { |
|
66 | |||
67 | /** |
||
68 | * @see PropertyIdProvider::getPropertyId |
||
69 | * |
||
70 | * @since 0.1 |
||
71 | * |
||
72 | * @return PropertyId |
||
73 | */ |
||
74 | 3 | public function getPropertyId() { |
|
77 | |||
78 | /** |
||
79 | * @see Hashable::getHash |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 16 | public function getHash() { |
|
86 | |||
87 | /** |
||
88 | * @see Comparable::equals |
||
89 | * |
||
90 | * @since 0.3 |
||
91 | * |
||
92 | * @param mixed $target |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | 12 | public function equals( $target ) { |
|
105 | |||
106 | /** |
||
107 | * @see Serializable::serialize |
||
108 | * |
||
109 | * @since 0.1 |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | 12 | public function serialize() { |
|
116 | |||
117 | /** |
||
118 | * @see Serializable::unserialize |
||
119 | * |
||
120 | * @since 0.1 |
||
121 | * |
||
122 | * @param string $serialized |
||
123 | */ |
||
124 | 2 | public function unserialize( $serialized ) { |
|
127 | |||
128 | /** |
||
129 | * @param string $name |
||
130 | * |
||
131 | * @return boolean |
||
132 | */ |
||
133 | public function hasFacet( $name ) { |
||
136 | |||
137 | /** |
||
138 | * @return string[] |
||
139 | */ |
||
140 | public function listFacets() { |
||
143 | |||
144 | /** |
||
145 | * @param string $name |
||
146 | * @param string|null $type The desired type |
||
147 | * |
||
148 | * @return object |
||
149 | */ |
||
150 | public function getFacet( $name, $type = null ) { |
||
157 | |||
158 | /** |
||
159 | * @param string $name |
||
160 | * @param object $facetObject |
||
161 | */ |
||
162 | public function addFacet( $name, $facetObject ) { |
||
169 | |||
170 | } |
||
171 |