Commit cbfa7e61 by Paul Klimov

"yii\sphinx\Command" and "yii\sphinx\QueryBuilder" extracted.

parent 7cc182fc
......@@ -10,6 +10,8 @@ namespace yii\sphinx;
/**
* Class Connection
*
* @method Schema getSchema() The schema information for this Sphinx connection
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
......@@ -22,4 +24,28 @@ class Connection extends \yii\db\Connection
'mysqli' => 'yii\sphinx\Schema', // MySQL
'mysql' => 'yii\sphinx\Schema', // MySQL
];
/**
* Obtains the schema information for the named index.
* @param string $name index name.
* @param boolean $refresh whether to reload the table schema even if it is found in the cache.
* @return IndexSchema index schema information. Null if the named index does not exist.
*/
public function getIndexSchema($name, $refresh = false)
{
return $this->getSchema()->getIndexSchema($name, $refresh);
}
/**
* Quotes a index name for use in a query.
* If the index name contains schema prefix, the prefix will also be properly quoted.
* If the index name is already quoted or contains special characters including '(', '[[' and '{{',
* then this method will do nothing.
* @param string $name index name
* @return string the properly quoted index name
*/
public function quoteIndexName($name)
{
return $this->getSchema()->quoteIndexName($name);
}
}
\ No newline at end of file
......@@ -103,7 +103,7 @@ class CommandTest extends SphinxTestCase
'title' => 'Test title',
'content' => 'Test content',
'type_id' => 2,
'category' => [41, 42],
//'category' => [41, 42],
'id' => 1,
]);
$this->assertEquals(1, $command->execute(), 'Unable to execute insert!');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment