44
55use InvalidArgumentException ;
66use OutOfBoundsException ;
7+ use Wikibase \DataModel \Entity \PropertyId ;
78
89/**
910 * Helper for managing objects grouped by property id.
@@ -40,14 +41,43 @@ public function __construct( array $propertyIdProviders ) {
4041 }
4142 }
4243
44+ /**
45+ * @since 0.2
46+ * @deprecated since 1.1
47+ */
48+ public function buildIndex () {}
49+
50+ /**
51+ * @since 0.2
52+ * @deprecated since 1.1
53+ *
54+ * @param PropertyId $propertyId
55+ * @return PropertyIdProvider[]
56+ *
57+ * @throws OutOfBoundsException
58+ */
59+ public function getByPropertyId ( PropertyId $ propertyId ) {
60+ return $ this ->byPropertyIdGrouper ->getForPropertyId ( $ propertyId );
61+ }
62+
63+ /**
64+ * @since 0.2
65+ * @deprecated since 1.1
66+ *
67+ * @return PropertyId[]
68+ */
69+ public function getPropertyIds () {
70+ return $ this ->byPropertyIdGrouper ->getPropertyIds ();
71+ }
72+
4373 /**
4474 * Returns a list of all PropertyIdProvider instances grouped by their PropertyId.
4575 *
46- * @since 1.1
76+ * @since 0.2
4777 *
4878 * @return PropertyIdProvider[]
4979 */
50- public function getFlatArray () {
80+ public function toFlatArray () {
5181 return $ this ->flatArray ;
5282 }
5383
@@ -74,15 +104,15 @@ public function getIndex( PropertyIdProvider $propertyIdProvider ) {
74104 /**
75105 * Adds the given PropertyIdProvider to the array at the given index.
76106 *
77- * @since 1.1
107+ * @since 0.2
78108 *
79109 * @param PropertyIdProvider $propertyIdProvider
80110 * @param int $index
81111 *
82112 * @throws InvalidArgumentException
83113 * @throws OutOfBoundsException
84114 */
85- public function addAtIndex ( PropertyIdProvider $ propertyIdProvider , $ index ) {
115+ public function addObjectAtIndex ( PropertyIdProvider $ propertyIdProvider , $ index ) {
86116 $ this ->assertValidIndex ( $ index );
87117
88118 $ groupIndices = $ this ->getFlatArrayGroupIndices ();
@@ -168,7 +198,7 @@ public function moveToIndex( $oldIndex, $newIndex ) {
168198 /**
169199 * Moves the given PropertyIdProvider to the new index and returns it.
170200 *
171- * @since 1.1
201+ * @since 0.2
172202 *
173203 * @param PropertyIdProvider $propertyIdProvider
174204 * @param int $index
@@ -177,7 +207,7 @@ public function moveToIndex( $oldIndex, $newIndex ) {
177207 * @throws InvalidArgumentException
178208 * @throws OutOfBoundsException
179209 */
180- public function moveObject ( PropertyIdProvider $ propertyIdProvider , $ index ) {
210+ public function moveObjectToIndex ( PropertyIdProvider $ propertyIdProvider , $ index ) {
181211 return $ this ->moveToIndex ( $ this ->getIndex ( $ propertyIdProvider ), $ index );
182212 }
183213
0 commit comments