本文整理匯總了PHP中Cake\Datasource\ConnectionManager::dropAlias方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConnectionManager::dropAlias方法的具體用法?PHP ConnectionManager::dropAlias怎麽用?PHP ConnectionManager::dropAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cake\Datasource\ConnectionManager
的用法示例。
在下文中一共展示了ConnectionManager::dropAlias方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: tearDown
/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
Plugin::unload();
ConnectionManager::drop('test_variant');
ConnectionManager::dropAlias('other_name');
}
示例2: testInvalidDB
public function testInvalidDB()
{
$this->setExpectedException('Chris48s\\Searchable\\Exception\\SearchableFatalException');
//set up a SQLite DB connection - SQLite is not supported
ConnectionManager::config('invalid', ['url' => 'sqlite:///:memory:', 'timezone' => 'UTC']);
$conn = ConnectionManager::get('invalid');
//create a table in SQLite
$conn->query("CREATE TABLE `Foo` (\n `id` int(11) NOT NULL,\n `textcol` VARCHAR(255),\n PRIMARY KEY (`id`)\n );");
$table = TableRegistry::get('Foo', ['connection' => $conn]);
$table->addBehavior('Chris48s/Searchable.Searchable');
//tidy up
ConnectionManager::dropAlias('invalid');
}
示例3: testInvalidDB
public function testInvalidDB()
{
$this->setExpectedException('Chris48s\\GeoDistance\\Exception\\GeoDistanceFatalException');
//set up a SQLite DB connection - SQLite is not supported
ConnectionManager::config('invalid', ['url' => 'sqlite:///:memory:', 'timezone' => 'UTC']);
$conn = ConnectionManager::get('invalid');
//create a table in SQLite
$conn->query("CREATE TABLE `Foo` (\n `id` int(11) NOT NULL,\n `lat` float,\n `lng` float,\n PRIMARY KEY (`id`)\n );");
$table = TableRegistry::get('Foo', ['connection' => $conn]);
$table->addBehavior('Chris48s/GeoDistance.GeoDistance', ['latitudeColumn' => 'lat', 'longitudeColumn' => 'lng']);
//tidy up
ConnectionManager::dropAlias('invalid');
}