oat-sa / lib-generis-search
Library provide an object search API
Installs: 91 134
Dependents: 4
Suggesters: 0
Security: 0
Stars: 2
Watchers: 49
Forks: 2
Open Issues: 1
Requires
Requires (Dev)
- mikey179/vfsstream: 1.4.0
- phpunit/phpunit: ^8.5
- dev-master
- 2.3.1
- 2.3.0
- v2.2.0
- V2.1.2
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- v0.1.0
- dev-develop
- dev-feature/sonarqube-integration
- dev-fix/phpunit8.5-upgrade
- dev-feature/getOption-escaper-driver
- dev-feature/update-zf-servicemanager
- dev-refactoring/TAO-5104/remove-globals-from-generis
- dev-doc/fix-FQCN
- dev-feature/new-operators
This package is auto-updated.
Last update: 2024-11-16 16:11:33 UTC
README
This library provide an object search API.
It use a query builder to store search criteria, a query serialyser to transform builder into an exploitable query for your database driver and a gateway to execute query.
It Will return an iterator.
see API Documentation at http://forge.taotesting.com/projects/tao/wiki/use-complex-search-API
usage example
/* @var $search \oat\oatbox\search\ComplexeSearchService */ $search = $this->getServiceManager()->get(\oat\generis\model\kernel\persistence\smoothsql\search\ComplexSearchService::SERVICE_ID); /* @var $queryBuilder \oat\search\QueryBuilder */ $queryBuilder = $search->query(); /* search for all test takers */ $query = $search ->searchType($queryBuilder, 'http://www.tao.lu/Ontologies/TAOSubject.rdf#Subject' , true) ->add('http://www.w3.org/2000/01/rdf-schema#label') ->contain('11'); $queryBuilder->setCriteria($query); /* return an iterator */ $result = $search->getGateway()->search($queryBuilder); /* get max result */ echo 'total : ' . $result->total() . '<br><br>'; /*@var $row \core_kernel_classes_Resource */ foreach ($result as $row) { /* each iterator entry is a resource object */ var_dump($row->getLabel()); echo '<br>'; }