当前位置: 首页>>代码示例>>PHP>>正文


PHP QuickBuilder::buildClasses方法代码示例

本文整理汇总了PHP中Propel\Generator\Util\QuickBuilder::buildClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBuilder::buildClasses方法的具体用法?PHP QuickBuilder::buildClasses怎么用?PHP QuickBuilder::buildClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Propel\Generator\Util\QuickBuilder的用法示例。


在下文中一共展示了QuickBuilder::buildClasses方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

    public function setUp()
    {
        if (!class_exists('\\Issue656TestObject')) {
            $schema = <<<EOF
<database>
    <table name="issue_656_test_object">
        <column name="ID" type="INTEGER" size="10" sqlType="int(10) unsigned" primaryKey="true" required="true" autoIncrement="true"/>
        <column name="Name" type="VARCHAR" size="45" required="true"/>
    </table>
    <table name="issue_656_test_object_from" isCrossRef="true">
        <column name="From" type="INTEGER" size="10" sqlType="int(10) unsigned" primaryKey="true" required="true"/>
        <column name="To" type="INTEGER" size="10" sqlType="int(10) unsigned" primaryKey="true" required="true"/>
        <foreign-key name="fk_test_object_from" foreignTable="issue_656_test_object">
            <reference local="From" foreign="ID"/>
        </foreign-key>
        <foreign-key name="fk_test_object_to" foreignTable="issue_656_test_object">
            <reference local="To" foreign="ID"/>
        </foreign-key>
    </table>
</database>
EOF;
            $builder = new QuickBuilder();
            $builder->setSchema($schema);
            $builder->buildClasses(null, true);
        }
    }
开发者ID:disider,项目名称:Propel2,代码行数:26,代码来源:Issue656Test.php

示例2: buildAndMigrate

 /**
  * Builds all classes and migrates the database.
  *
  * @param string $schema xml schema
  */
 public function buildAndMigrate($schema)
 {
     $builder = new QuickBuilder();
     $platform = $this->getPlatform();
     $builder->setPlatform($platform);
     $builder->setParser($this->getParser($this->con));
     $builder->getParser()->setPlatform($platform);
     $builder->setSchema($schema);
     $builder->buildClasses(null, true);
     $builder->updateDB($this->con);
 }
开发者ID:bondarovich,项目名称:Propel2,代码行数:16,代码来源:PlatformDatabaseBuildTimeBase.php

示例3: setUp

    public function setUp()
    {
        if (!class_exists('\\Base\\Issue1033Book')) {
            $schema = <<<EOF
<database>
    <table name="Issue1033Book">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" description="Book Id" />
        <column name="title" type="VARCHAR" required="true" description="Book Title" primaryString="true" />
    </table>
</database>
EOF;
            $builder = new QuickBuilder();
            $builder->setSchema($schema);
            $builder->buildClasses(null, true);
        }
    }
开发者ID:disider,项目名称:Propel2,代码行数:16,代码来源:Issue1033Test.php

示例4: testToArrayKeyTypePreDefined

    public function testToArrayKeyTypePreDefined()
    {
        $schema = <<<EOF
<database name="test"  namespace="MyNameSpace">
    <table name="test_key_type_table">
        <column name="id_key_type" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name_key_type" type="VARCHAR" />
    </table>
</database>
EOF;
        $builder = new QuickBuilder();
        $builder->setSchema($schema);
        $builder->getConfig()->setBuildProperty('defaultKeyType', 'studlyPhpName');
        $builder->buildClasses();
        $expectedKeys = array('idKeyType', 'nameKeyType');
        $object = new TestKeyTypeTable();
        $this->assertEquals($expectedKeys, array_keys($object->toArray()), 'toArray() returns an associative array with pre-defined key type in properties.');
    }
开发者ID:robin850,项目名称:Propel2,代码行数:18,代码来源:GeneratedObjectTest.php

示例5: testHydrateWithMysqlInvalidDate

    public function testHydrateWithMysqlInvalidDate()
    {
        $schema = <<<EOF
<database name="generated_object_complex_type_test_6">
<table name="complex_column_type_entity_6">
    <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;
        $builder = new QuickBuilder();
        $builder->setSchema($schema);
        $builder->setPlatform(new MysqlPlatform());
        $builder->buildClasses();
        $r = new \ComplexColumnTypeEntity6();
        $r->hydrate(array(123, '0000-00-00', '00:00:00', '0000-00-00 00:00:00'));
        $this->assertNull($r->getBar1());
        $this->assertEquals('00:00:00', $r->getBar2()->format('H:i:s'));
        $this->assertNull($r->getBar3());
    }
开发者ID:norfil,项目名称:Propel2,代码行数:22,代码来源:GeneratedObjectTemporalColumnTypeTest.php

示例6: buildClasses

 protected function buildClasses($schema)
 {
     $builder = new QuickBuilder();
     $builder->setSchema($schema);
     $builder->buildClasses();
 }
开发者ID:disider,项目名称:Propel2,代码行数:6,代码来源:ConstantNameTest.php

示例7: testGeneratedClassesWithTablePrefix

 /**
  * @dataProvider tablePrefixDataProvider
  */
 public function testGeneratedClassesWithTablePrefix($schema, $expectSQL, $expectClasses)
 {
     $builder = new QuickBuilder();
     $builder->setSchema($schema);
     $builder->buildClasses();
     foreach ($expectClasses as $expectClass) {
         $this->assertTrue(class_exists($expectClass), sprintf('expect class "%s" is not exists', $expectClass));
     }
 }
开发者ID:naldz,项目名称:cyberden,代码行数:12,代码来源:ArchivableBehaviorTest.php


注:本文中的Propel\Generator\Util\QuickBuilder::buildClasses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。