DBSqlBuilderWhereGroupSphinx Class Reference
[Sphinx]
Where Group Query Builder for Sphinx. More...
Inheritance diagram for
DBSqlBuilderWhereGroupSphinx:
Public Member Functions |
|
get_sql () | |
Return SQL fragment. |
|
Protected Member Functions |
|
translate_logical_operator ($operator) | |
Return Driver specific value for AND or OR.
|
Detailed Description
Where Group Query Builder for Sphinx.
Definition at line 8 of file dbsqlbuilder.wheregroup.sphinx.cls.php.
Member Function Documentation
DBSqlBuilderWhereGroupSphinx::get_sql | ( | ) |
Return SQL fragment.
- Returns:
- array Array with two members "filter" and "query"
Reimplemented from DBSqlBuilderWhereGroup.
Definition at line 14 of file dbsqlbuilder.wheregroup.sphinx.cls.php.
00014 { 00015 $query_ret = ''; 00016 $items_query = array(); 00017 $items_filter = array(); 00018 foreach($this->group->get_children() as $where) { 00019 $arr = $where->get_sql(); 00020 $items_filter = array_merge($items_filter, $arr['filter']); 00021 $query = $arr['query']; 00022 if (!empty($query)) { 00023 if (count($items_query)) { 00024 $this->push_item($items_query, $this->translate_logical_operator($where->get_logical_operator())); 00025 } 00026 $this->push_item($items_query, $query); 00027 } 00028 } 00029 if (count($items_query)) { 00030 // We did something, so $ret is not empty 00031 $query_ret = '(' . implode(' ', $items_query) . ')'; 00032 } 00033 return array( 00034 'filter' => $items_filter, 00035 'query' => $query_ret 00036 ); 00037 }
DBSqlBuilderWhereGroupSphinx::translate_logical_operator | ( | $ | operator | ) | [protected] |
Return Driver specific value for AND or OR.
Reimplemented from DBSqlBuilderWhereGroup.
Definition at line 42 of file dbsqlbuilder.wheregroup.sphinx.cls.php.
00042 { 00043 switch ($operator) { 00044 case DBWhere::LOGIC_OR: 00045 return '|'; 00046 default: 00047 return ''; 00048 } 00049 }
The documentation for this class was generated from the following file:
- contributions/sphinx/model/drivers/sphinx/sqlbuilder/dbsqlbuilder.wheregroup.sphinx.cls.php