當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。