Skip to content

Commit 4f25e05

Browse files
authored
SMW 2.4 SMWSql3SmwIds::getDataItemForId, refs 18 (#19)
1 parent 1e5fc81 commit 4f25e05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ChangeNotification/ChangeNotificationFilter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ private function getFixedPropertyValueBy( $tableChangeOp, $key ) {
173173
return method_exists( $tableChangeOp, 'getFixedPropertyValueFor' ) ? $tableChangeOp->getFixedPropertyValueFor( $key ) : $tableChangeOp->getFixedPropertyValueBy( $key );
174174
}
175175

176+
// 2.4 compat
177+
private function getDataItemById( $id ) {
178+
return method_exists( $this->store->getObjectIds(), 'getDataItemForId' ) ? $this->store->getObjectIds()->getDataItemForId( $id ) : $this->store->getObjectIds()->getDataItemById( $id );
179+
}
180+
176181
private function doFilterOnFieldChangeOps( $property, $tableChangeOp, $fieldChangeOps ) {
177182

178183
foreach ( $fieldChangeOps as $fieldChangeOp ) {
@@ -189,7 +194,7 @@ private function doFilterOnFieldChangeOps( $property, $tableChangeOp, $fieldChan
189194

190195
// Get DI representation to build a DataValues that allows
191196
// to match/compare values to its serialization form
192-
$dataItem = $this->store->getObjectIds()->getDataItemById(
197+
$dataItem = $this->getDataItemById(
193198
$fieldChangeOp->get( 'p_id' )
194199
);
195200

@@ -293,7 +298,7 @@ private function doCompareFields( $value, $fieldChangeOp, $dataItem, $subobjectN
293298
} elseif ( $fieldChangeOp->has( 'o_id' ) ) {
294299

295300
// Page object entities
296-
$oDataItem = $this->store->getObjectIds()->getDataItemById(
301+
$oDataItem = $this->getDataItemById(
297302
$fieldChangeOp->get( 'o_id' )
298303
);
299304
/*

0 commit comments

Comments
 (0)