Robert Vogel has uploaded a new change for review.
https://gerrit.wikimedia.org/r/264286
Change subject: BSApiExtJSStoreBase: Implemented filter logic...
......................................................................
BSApiExtJSStoreBase: Implemented filter logic...
... for field type 'bool'.
Change-Id: If89b063b3b511cef28494c1c98ebb005ade8f909
---
M includes/api/BSApiExtJSStoreBase.php
1 file changed, 17 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation
refs/changes/86/264286/1
diff --git a/includes/api/BSApiExtJSStoreBase.php
b/includes/api/BSApiExtJSStoreBase.php
index 23ed175..e9e9f2b 100644
--- a/includes/api/BSApiExtJSStoreBase.php
+++ b/includes/api/BSApiExtJSStoreBase.php
@@ -290,7 +290,13 @@
return false;
}
}
- //TODO: Implement for type 'date', 'datetime' and
'boolean'
+ if( $oFilter->type == 'boolean' ) {
+ $bFilterApplies = $this->filterBoolean(
$oFilter, $aDataSet );
+ if( !$bFilterApplies ) {
+ return false;
+ }
+ }
+ //TODO: Implement for type 'date' and 'datetime'
}
return true;
@@ -379,6 +385,16 @@
}
/**
+ * Performs list filtering based on given filter of type bool on a
dataset
+ * @param object $oFilter
+ * @param object $aDataSet
+ * @return boolean true if filter applies, false if not
+ */
+ public function filterBoolean($oFilter, $aDataSet) {
+ return $oFilter->value == $aDataSet->{$oFilter->field};
+ }
+
+ /**
* Applies pagination on the result
* @param array $aProcessedData The filtered result
* @return array a trimmed version of the result
--
To view, visit https://gerrit.wikimedia.org/r/264286
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If89b063b3b511cef28494c1c98ebb005ade8f909
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits