(No version information available, might only be in Git)

TokyoTyrantQuery::metaSearchRetrieve records with multiple queries


public TokyoTyrantQuery::metaSearch ( array $queries , int $type ) : array

Executes multiple queries on a database and returns matching records. The current object is always the left most object in the search.

Список параметров


Array of TokyoTyrantQuery objects


One of the TokyoTyrant::RDBMS_* constants

Возвращаемые значения

Returns the matching rows and throws TokyoTyrantException on error


Пример #1 TokyoTyrantQuery::metaSearch() example

/* Connect to a table database */
$tt = new TokyoTyrantTable("localhost"1979);

/* Add test data */
$tt->put('cherry',     array('color' => 'red'));
$tt->put('strawberry', array('color' => 'red'));
$tt->put('apple',      array('color' => 'green'));
$tt->put('lemon',      array('color' => 'yellow'));

/* First query */
$query $tt->getQuery();

/* Second query */
$query1 $tt->getQuery();

/* Get union between the queries */
var_dump($query->metaSearch(array($query1), TokyoTyrant::RDBMS_UNION));

Результат выполнения данного примера:

array(3) {
  array(1) {
    string(3) "red"
  array(1) {
    string(3) "red"
  array(1) {
    string(6) "yellow"

Смотрите также

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top