本文整理汇总了PHP中fORMSchema::attach方法的典型用法代码示例。如果您正苦于以下问题:PHP fORMSchema::attach方法的具体用法?PHP fORMSchema::attach怎么用?PHP fORMSchema::attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fORMSchema
的用法示例。
在下文中一共展示了fORMSchema::attach方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
if (defined('SKIPPING')) {
return;
}
$db = new fDatabase(DB_TYPE, DB, DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT);
if (DB_TYPE == 'sqlite') {
$db->execute(file_get_contents(DB_SETUP_FILE));
$db->execute(file_get_contents(DB_EXTENDED_SETUP_FILE));
}
$db->execute(file_get_contents(DB_POPULATE_FILE));
$db->execute(file_get_contents(DB_EXTENDED_POPULATE_FILE));
self::$db = $db;
self::$schema = new fSchema($db);
fORMDatabase::attach(self::$db);
fORMSchema::attach(self::$schema);
fORMOrdering::configureOrderingColumn('TopAlbum', 'position');
fORMOrdering::configureOrderingColumn('FavoriteAlbum', 'position');
fORMOrdering::configureOrderingColumn('YearFavoriteAlbum', 'position');
if (defined('MAP_TABLES')) {
fORM::mapClassToTable('User', 'user');
fORM::mapClassToTable('Group', 'group');
fORM::mapClassToTable('Artist', 'popular_artists');
fORM::mapClassToTable('Album', 'records');
}
}
示例2: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
fORMDatabase::attach(self::$db);
fORMSchema::attach(self::$schema);
if (defined('MAP_TABLES')) {
fORM::mapClassToTable('User', 'user');
fORM::mapClassToTable('Group', 'group');
fORM::mapClassToTable('Artist', 'popular_artists');
fORM::mapClassToTable('Album', 'records');
}
}
示例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
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');
}
示例5: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
$db = $this->sharedFixture['db'];
$db->execute(file_get_contents(DB_EXTENDED_SETUP_FILE));
$db->clearCache();
fORMDatabase::attach($db);
fORMSchema::attach($this->sharedFixture['schema']);
fORMOrdering::configureOrderingColumn('TopAlbum', 'position');
fORMOrdering::configureOrderingColumn('FavoriteAlbum', 'position');
fORMOrdering::configureOrderingColumn('YearFavoriteAlbum', 'position');
if (defined('MAP_TABLES')) {
fORM::mapClassToTable('User', 'user');
fORM::mapClassToTable('Group', 'group');
fORM::mapClassToTable('Artist', 'popular_artists');
fORM::mapClassToTable('Album', 'records');
}
}
示例6: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
fORMDatabase::attach($this->sharedFixture['db']);
fORMSchema::attach($this->sharedFixture['schema']);
fORM::mapClassToTable('Flourish2User', fix_schema('flourish2.users'));
fORM::mapClassToTable('Flourish2Group', fix_schema('flourish2.groups'));
fORM::mapClassToTable('Flourish2Artist', fix_schema('flourish2.artists'));
fORM::mapClassToTable('Flourish2Album', fix_schema('flourish2.albums'));
}
示例7: setUp
public function setUp()
{
if (defined('SKIPPING')) {
$this->markTestSkipped();
}
fORMDatabase::attach($this->sharedFixture['db']);
fORMSchema::attach($this->sharedFixture['schema']);
if (defined('MAP_TABLES')) {
fORM::mapClassToTable('User', 'user');
fORM::mapClassToTable('Group', 'group');
fORM::mapClassToTable('Artist', 'popular_artists');
fORM::mapClassToTable('Album', 'records');
}
fORM::registerActiveRecordMethod('User', 'hasChanged', 'changed');
}
示例8: fDatabase
<?php
include_once 'config.php';
include_once 'schema.php';
include_once 'util.php';
include 'models/Event.php';
include 'models/EventTime.php';
$database = new fDatabase('mysql', $DBDB, $DBUSER, $DBPASS, $DBHOST);
fORMDatabase::attach($database);
$schema = updateSchema($database);
fORMSchema::attach($schema);
/**
* Automatically includes classes
*
* @throws Exception
*
* @param string $class_name Name of the class to load
* @return void
*/
function __autoload($class_name)
{
// Customize this to your root Flourish directory
$flourish_root = getcwd() . '/../vendor/flourish/';
$file = $flourish_root . $class_name . '.php';
if (file_exists($file)) {
include $file;
return;
}
throw new Exception('The class ' . $class_name . ' could not be loaded');
}