本文整理汇总了PHP中Propel\Generator\Util\QuickBuilder::buildSchema方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBuilder::buildSchema方法的具体用法?PHP QuickBuilder::buildSchema怎么用?PHP QuickBuilder::buildSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Util\QuickBuilder
的用法示例。
在下文中一共展示了QuickBuilder::buildSchema方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
if (!class_exists('ConcreteInheritanceBehaviorWithBehaviorExclusionTest\\ConcreteInheritanceParentQuery')) {
$schema = <<<EOF
<database name="concrete_inheritance_behavior_exclusion" namespace="ConcreteInheritanceBehaviorWithBehaviorExclusionTest">
<table name="concrete_inheritance_parent" allowPkInsert="true">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<behavior name="sluggable">
<parameter name="scope_column" value="title" />
</behavior>
<behavior name="timestampable" />
<index>
<index-column name="title" />
</index>
</table>
<table name="concrete_inheritance_child" allowPkInsert="true">
<column name="body" type="longvarchar" />
<column name="author_id" required="false" type="INTEGER" />
<behavior name="concrete_inheritance">
<parameter name="extends" value="concrete_inheritance_parent" />
<parameter name="copy_data_to_child" value="slug" />
<parameter name="exclude_behaviors" value="sluggable" />
</behavior>
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}
示例2: setUp
public function setUp()
{
if (!class_exists('\\Issue733Test1')) {
$schema = <<<EOF
<database name="issue_733_test">
<table name="issue_733_test_1">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="foo" type="INTEGER" />
<column name="bar" type="VARCHAR" size="100" />
<behavior name="i18n">
<parameter name="i18n_columns" value="bar" />
<parameter name="locale_column" value="language" />
</behavior>
</table>
<table name="issue_733_test_2">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="foo" type="INTEGER" />
<column name="bar" type="VARCHAR" size="100" />
<behavior name="i18n">
<parameter name="i18n_columns" value="bar" />
<parameter name="locale_column" value="language" />
<parameter name="locale_alias" value="culture" />
</behavior>
</table>
</database>
EOF;
$this->con = QuickBuilder::buildSchema($schema);
}
}
示例3: setUp
public function setUp()
{
if (!class_exists('MyNameSpace\\ComplexColumnTypeEntitySet')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_set" namespace="MyNameSpace">
<table name="complex_column_type_entity_set">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="tags" type="SET" valueSet="foo, bar, baz, 1, 4,(, foo bar " />
<column name="bar" type="SET" valueSet="foo, bar" />
<column name="defaults" type="SET" valueSet="foo, bar, foo baz" defaultValue="bar" />
<column name="bears" type="SET" valueSet="foo, bar, baz, kevin" defaultValue="bar, baz" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
// ok this is hackish but it makes testing of getter and setter independent of each other
$publicAccessorCode = <<<EOF
class PublicComplexColumnTypeEntitySet extends MyNameSpace\\ComplexColumnTypeEntitySet
{
public \$bar;
public \$tags;
}
EOF;
eval($publicAccessorCode);
}
ComplexColumnTypeEntitySetTableMap::doDeleteAll();
}
示例4: setUp
protected function setUp()
{
parent::setUp();
if (!class_exists('\\Nature')) {
$schema = '
<database>
<table name="recherche" phpName="Recherche">
<column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
</table>
<table name="recherche_nature" phpName="RechercheNature" isCrossRef="true">
<column name="recherche_id" type="integer" primaryKey="true"/>
<column name="nature_id" type="integer" primaryKey="true"/>
<foreign-key foreignTable="recherche" onDelete="cascade">
<reference local="recherche_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="nature">
<reference local="nature_id" foreign="id"/>
</foreign-key>
</table>
<table name="nature" phpName="Nature">
<column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
</table>
</database>
';
QuickBuilder::buildSchema($schema);
}
}
示例5: setUp
public function setUp()
{
if (!class_exists('\\ComplexColumnTypeEntity11')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_11">
<table name="complex_column_type_entity_11">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="tags" type="ARRAY" />
<column name="value_set" type="ARRAY" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
$e0 = new \ComplexColumnTypeEntity11();
$e0->save();
$e1 = new \ComplexColumnTypeEntity11();
$e1->setTags(array('foo', 'bar', 'baz'));
$e1->save();
$e2 = new \ComplexColumnTypeEntity11();
$e2->setTags(array('bar'));
$e2->save();
$e3 = new \ComplexColumnTypeEntity11();
$e3->setTags(array('bar23'));
$e3->save();
}
}
示例6: setUp
protected function setUp()
{
parent::setUp();
if (!class_exists('Propel\\Bundle\\PropelBundle\\Tests\\Fixtures\\DataFixtures\\Loader\\CoolBook')) {
$schema = <<<XML
<database name="default" package="vendor.bundles.Propel.Bundle.PropelBundle.Tests.Fixtures.DataFixtures.Loader" namespace="Propel\\Bundle\\PropelBundle\\Tests\\Fixtures\\DataFixtures\\Loader" defaultIdMethod="native">
<table name="cool_book">
<column name="id" type="integer" primaryKey="true" />
<column name="name" type="varchar" size="255" />
<column name="description" type="varchar" />
<column name="author_id" type="integer" required="false" defaultValue="null" />
<column name="complementary_infos" required="false" type="object" description="An object column" />
<foreign-key foreignTable="cool_book_author" onDelete="CASCADE" onUpdate="CASCADE">
<reference local="author_id" foreign="id" />
</foreign-key>
</table>
<table name="cool_book_author">
<column name="id" type="integer" primaryKey="true" />
<column name="name" type="varchar" size="255" />
</table>
</database>
XML;
QuickBuilder::buildSchema($schema);
}
$this->con = Propel::getServiceContainer()->getConnection('default');
$this->con->beginTransaction();
}
示例7: testObjectColumnType
public function testObjectColumnType()
{
$schema = <<<EOF
<database name="generated_object_complex_type_test_1">
<table name="complex_column_type_entity_1">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="bar" type="OBJECT" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
$e = new \ComplexColumnTypeEntity1();
$this->assertNull($e->getBar(), 'object columns are null by default');
$c = new FooColumnValue();
$c->bar = 1234;
$e->setBar($c);
$this->assertEquals($c, $e->getBar(), 'object columns can store objects');
$e->setBar(null);
$this->assertNull($e->getBar(), 'object columns are nullable');
$e->setBar($c);
$e->save();
\ComplexColumnTypeEntity1Peer::clearInstancePool();
$e = \ComplexColumnTypeEntity1Query::create()->findOne();
$this->assertEquals($c, $e->getBar(), 'object columns are persisted');
}
示例8: setUp
public function setUp()
{
if (!class_exists('\\ComplexColumnTypeEntitySet2')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_set_2">
<table name="complex_column_type_entity_set_2">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="tags" valueSet="foo, bar, baz, bar23" type="SET" />
<column name="value_set" valueSet="foo, bar, baz, kevin" type="SET" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
$e0 = new \ComplexColumnTypeEntitySet2();
$e0->save();
$e1 = new \ComplexColumnTypeEntitySet2();
$e1->setTags(['foo', 'bar', 'baz']);
$e1->save();
$e2 = new \ComplexColumnTypeEntitySet2();
$e2->setTags(['bar']);
$e2->save();
$e3 = new \ComplexColumnTypeEntitySet2();
$e3->setTags(['bar23']);
$e3->save();
}
}
示例9: setUp
public function setUp()
{
parent::setUp();
if (!class_exists('ConcreteContentSetPkQuery')) {
$schema = <<<EOF
<database name="concrete_content_set_pk">
<table name="concrete_content_set_pk" allowPkInsert="true">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<index>
<index-column name="title" />
</index>
</table>
<table name="concrete_article_set_pk" allowPkInsert="true">
<column name="body" type="longvarchar" />
<column name="author_id" required="false" type="INTEGER" />
<behavior name="concrete_inheritance">
<parameter name="extends" value="concrete_content_set_pk" />
</behavior>
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}
示例10: setUp
public function setUp()
{
$this->c1 = new FooColumnValue2();
$this->c1->bar = 1234;
$this->c2 = new FooColumnValue2();
$this->c2->bar = 5678;
if (!class_exists('ComplexColumnTypeEntity10')) {
$schema = <<<EOF
<database name="generated_query_complex_type_test_10">
<table name="complex_column_type_entity_10">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="bar" type="OBJECT" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
$e0 = new \ComplexColumnTypeEntity10();
$e0->save();
$e1 = new \ComplexColumnTypeEntity10();
$e1->setBar($this->c1);
$e1->save();
$e2 = new \ComplexColumnTypeEntity10();
$e2->setBar($this->c2);
$e2->save();
\ComplexColumnTypeEntity10Peer::clearInstancePool();
}
}
示例11: setUp
public function setUp()
{
if (!class_exists('\\OptimisticLockingTable')) {
$schema = <<<EOF
<database name="optimistic_locker_behavior_test">
<table name="optimistic_locking_table">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<column name="related_id" type="INTEGER" />
<behavior name="MJS\\OptimisticLocking\\OptimisticLockingBehavior" />
<foreign-key foreignTable="optimistic_locking_related_table">
<reference local="related_id" foreign="id" />
</foreign-key>
</table>
<table name="optimistic_locking_related_table">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="name" type="VARCHAR" size="100" primaryString="true" />
</table>
<table name="optimistic_locking_versionable_table">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<column name="related_id" type="INTEGER" />
<behavior name="MJS\\OptimisticLocking\\OptimisticLockingBehavior" />
<behavior name="versionable" />
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}
示例12: setUp
public function setUp()
{
if (!class_exists('\\ChangeloggerBehaviorSingle')) {
$schema = <<<EOF
<database name="changelogger_behavior_test">
<table name="changelogger_behavior_single">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<behavior name="MJS\\ChangeLogger\\ChangeLoggerBehavior">
<parameter name="log" value="title"/>
<parameter name="comment" value="true"/>
<parameter name="created_by" value="true"/>
</behavior>
</table>
<table name="changelogger_behavior_multiple">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<behavior name="MJS\\ChangeLogger\\ChangeLoggerBehavior">
<parameter name="log" value="title, age"/>
</behavior>
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}
示例13: setUp
public function setUp()
{
if (!class_exists('\\I18nBehaviorTest11')) {
$schema = <<<EOF
<database name="i18n_behavior_test_10" identifierQuoting="true">
<table name="i18n_behavior_test_11">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="foo" type="INTEGER" />
<column name="bar" type="VARCHAR" size="100" />
<behavior name="i18n">
<parameter name="i18n_columns" value="bar" />
</behavior>
</table>
<table name="i18n_behavior_test_12">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="foo" type="INTEGER" />
<column name="bar1" type="VARCHAR" size="100" />
<column name="bar2" type="LONGVARCHAR" lazyLoad="true" />
<column name="bar3" type="TIMESTAMP" />
<column name="bar4" type="LONGVARCHAR" description="This is the Bar4 column" />
<behavior name="i18n">
<parameter name="i18n_columns" value="bar1,bar2,bar3,bar4" />
<parameter name="default_locale" value="fr_FR" />
<parameter name="locale_alias" value="culture" />
</behavior>
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}
示例14: setUp
public function setUp()
{
if (!class_exists('NestedSetTable9')) {
$schema = <<<XML
<database name="bookstore-behavior" defaultIdMethod="native">
<table name="nested_set_table9">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<behavior name="nested_set" />
</table>
<table name="nested_set_table10">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="my_left_column" type="INTEGER" required="false"/>
<column name="my_right_column" type="INTEGER" required="false"/>
<column name="my_level_column" type="INTEGER" required="false"/>
<column name="my_scope_column" type="INTEGER" required="false"/>
<behavior name="nested_set">
<parameter name="left_column" value="my_left_column" />
<parameter name="right_column" value="my_right_column" />
<parameter name="level_column" value="my_level_column" />
<parameter name="use_scope" value="true" />
<parameter name="scope_column" value="my_scope_column" />
<parameter name="method_proxies" value="true" />
</behavior>
</table>
</database>
XML;
$this->con = QuickBuilder::buildSchema($schema);
}
}
示例15: setUp
public function setUp()
{
if (!class_exists('\\ArchivableTest100')) {
$schema = <<<EOF
<database name="archivable_behavior_test_100">
<table name="archivable_test_100">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<column name="foo_id" type="INTEGER" />
<foreign-key foreignTable="archivable_test_200">
<reference local="foo_id" foreign="id" />
</foreign-key>
<index>
<index-column name="title" />
<index-column name="age" />
</index>
<behavior name="archivable" />
</table>
<table name="archivable_test_200">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<behavior name="archivable" />
</table>
<table name="archivable_test_200_archive">
<column name="id" required="true" primaryKey="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
</table>
<table name="archivable_test_300">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<column name="foo_id" type="INTEGER" />
<behavior name="archivable">
<parameter name="log_archived_at" value="false" />
<parameter name="archive_table" value="my_old_archivable_test_300" />
<parameter name="archive_on_insert" value="true" />
<parameter name="archive_on_update" value="true" />
<parameter name="archive_on_delete" value="false" />
</behavior>
</table>
<table name="archivable_test_400">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
<column name="age" type="INTEGER" />
<behavior name="archivable">
<parameter name="archive_class" value="\\Propel\\Tests\\Generator\\Behavior\\Archivable\\FooArchive" />
</behavior>
</table>
</database>
EOF;
QuickBuilder::buildSchema($schema);
}
}