當前位置: 首頁>>代碼示例>>PHP>>正文


PHP fORMSchema::attach方法代碼示例

本文整理匯總了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');
     }
 }
開發者ID:nurulimamnotes,項目名稱:flourish-old,代碼行數:26,代碼來源:fORMOrderingTest.php

示例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');
     }
 }
開發者ID:netcarver,項目名稱:flourish,代碼行數:14,代碼來源:fORMValidationTest.php

示例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');
 }
開發者ID:netcarver,項目名稱:flourish,代碼行數:14,代碼來源:fActiveRecordWithMultipleDatabasesTest.php

示例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');
 }
開發者ID:philip,項目名稱:flourish,代碼行數:14,代碼來源:fActiveRecordWithMultipleDatabasesTest.php

示例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');
     }
 }
開發者ID:philip,項目名稱:flourish,代碼行數:20,代碼來源:fORMOrderingTest.php

示例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'));
 }
開發者ID:philip,項目名稱:flourish,代碼行數:12,代碼來源:fActiveRecordWithMultipleSchemasTest.php

示例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');
 }
開發者ID:philip,項目名稱:flourish,代碼行數:15,代碼來源:fActiveRecordTest.php

示例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');
}
開發者ID:ejegg,項目名稱:shiftcal,代碼行數:30,代碼來源:init.php


注:本文中的fORMSchema::attach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。