本文整理汇总了PHP中PropelQuickBuilder::buildSchema方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelQuickBuilder::buildSchema方法的具体用法?PHP PropelQuickBuilder::buildSchema怎么用?PHP PropelQuickBuilder::buildSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelQuickBuilder
的用法示例。
在下文中一共展示了PropelQuickBuilder::buildSchema方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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">
\t<table name="complex_column_type_entity_10">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="bar" type="OBJECT" />
\t</table>
</database>
EOF;
PropelQuickBuilder::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();
}
}
示例2: setUp
public function setUp()
{
if (!class_exists('ArchivableConcretePagePeer')) {
$schema = <<<EOF
<database name="archivable_concrete_behavior_test_0">
<table name="parent_archivable_concrete_page">
<column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
<column name="content" type="longvarchar" required="true" />
<behavior name="archivable" />
</table>
<table name="archivable_concrete_page">
<column name="paragraph" type="integer" required="true" />
<behavior name="concrete_inheritance">
<parameter name="extends" value="parent_archivable_concrete_page" />
</behavior>
<behavior name="archivable" />
</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
ArchivableConcretePagePeer::doDeleteAll();
ArchivableConcretePageArchivePeer::doDeleteAll();
}
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:26,代码来源:ArchivableAndConcreteInheritanceBehaviorTest.php
示例3: 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;
PropelQuickBuilder::buildSchema($schema);
}
}
示例4: testObjectColumnType
public function testObjectColumnType()
{
$schema = <<<EOF
<database name="generated_object_complex_type_test_1">
\t<table name="complex_column_type_entity_1">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="bar" type="OBJECT" />
\t</table>
</database>
EOF;
PropelQuickBuilder::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');
}
示例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;
PropelQuickBuilder::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
public function setUp()
{
if (!class_exists('I18nBehaviorTest11')) {
$schema = <<<EOF
<database name="i18n_behavior_test_10">
\t<table name="i18n_behavior_test_11">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="foo" type="INTEGER" />
\t\t<column name="bar" type="VARCHAR" size="100" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="bar" />
\t\t</behavior>
\t</table>
\t<table name="i18n_behavior_test_12">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="foo" type="INTEGER" />
\t\t<column name="bar1" type="VARCHAR" size="100" />
\t\t<column name="bar2" type="LONGVARCHAR" lazyLoad="true" />
\t\t<column name="bar3" type="TIMESTAMP" />
\t\t<column name="bar4" type="LONGVARCHAR" description="This is the Bar4 column" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="bar1,bar2,bar3,bar4" />
\t\t\t<parameter name="default_locale" value="fr_FR" />
\t\t\t<parameter name="locale_alias" value="culture" />
\t\t</behavior>
\t</table>
</database>
EOF;
//PropelQuickBuilder::debugClassesForTable($schema, 'i18n_behavior_test_11');
PropelQuickBuilder::buildSchema($schema);
}
}
示例7: setUp
public function setUp()
{
if (!class_exists('ArchivableTest10')) {
$schema = <<<EOF
<database name="archivable_behavior_test_10">
\t<table name="archivable_test_10">
\t\t<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
\t\t<column name="title" type="VARCHAR" size="100" primaryString="true" />
\t\t<column name="age" type="INTEGER" />
\t\t<column name="foo_id" type="INTEGER" />
\t\t<foreign-key foreignTable="archivable_test_20">
\t\t\t<reference local="foo_id" foreign="id" />
\t\t</foreign-key>
\t\t<index>
\t\t\t<index-column name="title" />
\t\t\t<index-column name="age" />
\t\t</index>
\t\t<behavior name="archivable" />
\t</table>
\t<table name="archivable_test_20">
\t\t<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
\t\t<column name="title" type="VARCHAR" size="100" primaryString="true" />
\t\t<behavior name="archivable" />
\t</table>
\t<table name="archivable_test_20_archive">
\t\t<column name="id" required="true" primaryKey="true" type="INTEGER" />
\t\t<column name="title" type="VARCHAR" size="100" primaryString="true" />
\t</table>
\t<table name="archivable_test_30">
\t\t<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
\t\t<column name="title" type="VARCHAR" size="100" primaryString="true" />
\t\t<column name="age" type="INTEGER" />
\t\t<column name="foo_id" type="INTEGER" />
\t\t<behavior name="archivable">
\t\t\t<parameter name="log_archived_at" value="false" />
\t\t\t<parameter name="archive_table" value="my_old_archivable_test_30" />
\t\t\t<parameter name="archive_on_insert" value="true" />
\t\t\t<parameter name="archive_on_update" value="true" />
\t\t\t<parameter name="archive_on_delete" value="false" />
\t\t</behavior>
\t</table>
\t<table name="archivable_test_40">
\t\t<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
\t\t<column name="title" type="VARCHAR" size="100" primaryString="true" />
\t\t<column name="age" type="INTEGER" />
\t\t<behavior name="archivable">
\t\t\t<parameter name="archive_class" value="FooArchive" />
\t\t</behavior>
\t</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例8: setUp
public function setUp()
{
if (!class_exists('I18nBehaviorTest1')) {
$schema = <<<EOF
<database name="i18n_behavior_test_1">
\t<table name="i18n_behavior_test_1">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="foo" type="INTEGER" />
\t\t<column name="bar" type="VARCHAR" size="100" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="bar" />
\t\t</behavior>
\t</table>
\t<table name="i18n_behavior_test_2">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="foo" type="INTEGER" />
\t\t<column name="bar1" type="VARCHAR" size="100" />
\t\t<column name="bar2" type="LONGVARCHAR" lazyLoad="true" />
\t\t<column name="bar3" type="TIMESTAMP" />
\t\t<column name="bar4" type="LONGVARCHAR" description="This is the Bar4 column" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="bar1,bar2,bar3,bar4" />
\t\t\t<parameter name="default_locale" value="fr_FR" />
\t\t\t<parameter name="locale_alias" value="culture" />
\t\t</behavior>
\t</table>
\t<table name="movie">
\t\t<column name="id" type="integer" required="true" primaryKey="true" autoincrement="true" />
\t\t<column name="director" type="varchar" size="255" />
\t\t<column name="title" type="varchar" primaryString="true" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="title" />
\t\t\t<parameter name="locale_alias" value="culture" />
\t\t</behavior>
\t</table>
\t<table name="toy">
\t\t<column name="id" type="integer" required="true" primaryKey="true" autoincrement="true" />
\t\t<column name="ref" type="varchar" size="255" />
\t\t<column name="name" type="varchar" size="255" />
\t\t<behavior name="i18n">
\t\t\t<parameter name="i18n_columns" value="name" />
\t\t\t<parameter name="locale_alias" value="culture" />
\t\t</behavior>
\t\t<column name="movie_id" type="integer" />
\t\t<foreign-key foreignTable="movie">
\t\t\t<reference local="movie_id" foreign="id" />
\t\t</foreign-key>
\t</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例9: setUp
public function setUp()
{
if (!class_exists('ComplexColumnTypeEntity103Peer')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_103">
<table name="complex_column_type_entity_103">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="bar" type="ENUM" valueSet="foo, bar, baz, 1, 4,(, foo bar " />
</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例10: setUp
public function setUp()
{
if (!class_exists('ComplexColumnTypeEntity1')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_1">
\t<table name="complex_column_type_entity_1">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="bar" type="OBJECT" />
\t</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例11: setUp
public function setUp()
{
if (!class_exists('VersionableBehaviorTest10')) {
$schema = <<<EOF
<database name="versionable_behavior_test_10">
\t<table name="versionable_behavior_test_10">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="bar" type="INTEGER" />
\t\t<behavior name="versionable" />
\t</table>
</database>>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例12: setUp
public function setUp()
{
if (!class_exists('ComplexColumnTypeEntity2')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_2">
<table name="complex_column_type_entity_2">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="tags" type="ARRAY" />
<column name="value_set" type="ARRAY" />
</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例13: setUp
public function setUp()
{
if (!class_exists('MyAuditableTable')) {
$schema = <<<EOF
<database name="auditable_behavior_test_applied_on_table">
<table name="my_auditable_table">
<column name="id" type="INTEGER" primaryKey="true" autoincrement="true" />
<column name="name" type="VARCHAR" size="255" />
<behavior name="auditable" />
</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例14: setUp
public function setUp()
{
if (!class_exists('ComplexColumnTypeEntity5')) {
$schema = <<<EOF
<database name="generated_object_complex_type_test_5">
<table name="complex_column_type_entity_5">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="bar1" type="DATE" />
<column name="bar2" type="TIME" />
<column name="bar3" type="TIMESTAMP" />
</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}
示例15: setUp
public function setUp()
{
if (!class_exists('LazyLoadActiveRecord2')) {
$schema = <<<EOF
<database name="lazy_load_active_record_2">
\t<table name="lazy_load_active_record_2">
\t\t<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
\t\t<column name="foo" type="VARCHAR" size="100" />
\t\t<column name="bar" type="VARCHAR" size="100" lazyLoad="true" />
\t\t<column name="baz" type="VARCHAR" size="100" />
\t</table>
</database>
EOF;
PropelQuickBuilder::buildSchema($schema);
}
}