User:Vedmaka/Semantic Query Interface
Usage examples
editHow to query for page properties?
edit$sqi = new \SQI\SemanticQueryInterface(); $properties = $sqi->from("SomePage")->toArray();
How to search for pages with specific property value?
edit$pages = $sqi->condition('My property', "Target value")->toArray();
How to get all pages from category?
edit$pages = $sqi->category("Some category")->toArray();
How to get pages match multiple conditions?
edit$pages = $sqi->condition('PropA','ValueA') ->condition('PropB','ValueB') ->condition('PropC','ValueC') ->toArray();
How to get specified property value from some page?
edit$value = $sqi->from('Some page')->printout('Specified property name')->toArray();
How to limit or offset query?
edit$sqi->category('One category')->category('And another category')->limit(10)->offset(5)->toArray();
How to count result?
edit$count = $sqi->from('Some page')->count();
How to sort result?
$sqi->sort('', 'DESC') // Sort by pagename descending $sqi->sort('Property1', 'ASC') // Sort by property Property1 ascending
Note: every result page have special properties included:
- Categories (array)
- SubcategoryOf
- ModificationDate
- CreationDate
- LastEditor
Downloads
editYou can download master branch from github. Please feel free to submit bugs and pull-requests.