本文整理汇总了PHP中fORM::mapClassToDatabase方法的典型用法代码示例。如果您正苦于以下问题:PHP fORM::mapClassToDatabase方法的具体用法?PHP fORM::mapClassToDatabase怎么用?PHP fORM::mapClassToDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fORM
的用法示例。
在下文中一共展示了fORM::mapClassToDatabase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testClassToDatabaseMapping
public function testClassToDatabaseMapping()
{
$this->assertEquals('default', fORM::getDatabaseName('User'));
$this->assertEquals('default', fORM::getDatabaseName('PhotoGallery'));
fORM::mapClassToDatabase('User', 'second_db');
$this->assertEquals('second_db', fORM::getDatabaseName('User'));
}
示例2: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
fORMDatabase::attach($this->sharedFixture['db']);
fORMDatabase::attach($this->sharedFixture['db2'], 'db2');
fORMSchema::attach($this->sharedFixture['schema']);
fORMSchema::attach($this->sharedFixture['schema2'], 'db2');
fORM::mapClassToTable('Db2User', 'users');
fORM::mapClassToDatabase('Db2User', 'db2');
fORM::mapClassToTable('Db2Group', 'groups');
fORM::mapClassToDatabase('Db2Group', 'db2');
}
示例3: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
fORMDatabase::attach(self::$db);
fORMDatabase::attach(self::$db2, 'db2');
fORMSchema::attach(self::$schema);
fORMSchema::attach(self::$schema2, 'db2');
fORM::mapClassToTable('Db2User', 'users');
fORM::mapClassToDatabase('Db2User', 'db2');
fORM::mapClassToTable('Db2Group', 'groups');
fORM::mapClassToDatabase('Db2Group', 'db2');
}
示例4: setUp
protected function setUp()
{
if (defined('SKIPPING')) {
return;
}
$db = new fDatabase(DB_TYPE, DB, DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT);
$db->execute(file_get_contents(DB_SETUP_FILE));
$db2 = new fDatabase(DB_TYPE, DB_2, DB_2_USERNAME, DB_2_PASSWORD, DB_2_HOST, DB_2_PORT);
$db2->execute(file_get_contents(DB_2_SETUP_FILE));
$this->sharedFixture = array($db, $db2);
fORMDatabase::attach($db);
fORMDatabase::attach($db2, 'db2');
fORM::mapClassToTable('Db2User', 'users');
fORM::mapClassToDatabase('Db2User', 'db2');
fORM::mapClassToTable('Db2Group', 'groups');
fORM::mapClassToDatabase('Db2Group', 'db2');
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
if (defined('SKIPPING')) {
return;
}
$db = new fDatabase(DB_TYPE, DB, DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT);
$db->execute(file_get_contents(DB_SETUP_FILE));
$db2 = new fDatabase(DB_TYPE, DB_2, DB_2_USERNAME, DB_2_PASSWORD, DB_2_HOST, DB_2_PORT);
$db2->execute(file_get_contents(DB_2_SETUP_FILE));
self::$db = $db;
self::$db2 = $db2;
fORMDatabase::attach($db);
fORMDatabase::attach($db2, 'db2');
fORM::mapClassToTable('Db2User', 'users');
fORM::mapClassToDatabase('Db2User', 'db2');
fORM::mapClassToTable('Db2Group', 'groups');
fORM::mapClassToDatabase('Db2Group', 'db2');
}