Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle SPARQLStore backends #861

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions formats/datatables/SearchPanes.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public function __construct( $datatables ) {
* @return array
*/
public function getSearchPanes( $printRequests, $searchPanesOptions ) {
if ( $this->datatables->store instanceof \SMW\SPARQLStore\SPARQLStore ) {
// we got a SPARQLStore, which is not subclass of SQLStore
// dirty hack to access the private member baseStore, which is an instance of SQLStore
// this can be simplified once SPARQLStore is refactored to make this member public
// see https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/827
$closure = \Closure::bind( function &( \SMW\SPARQLStore\SPARQLStore $class ) {
return $class->baseStore;
}, null, \SMW\SPARQLStore\SPARQLStore::class );
$this->datatables->store = &$closure( $this->datatables->store );
}
$this->queryEngineFactory = new QueryEngineFactory( $this->datatables->store );
$this->connection = $this->datatables->store->getConnection( 'mw.db.queryengine' );
$this->queryFactory = new QueryFactory();
Expand Down
Loading