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


PHP QuickBuilder::getConfig方法代码示例

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


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

示例1: setUp

    public function setUp()
    {
        if (!class_exists('TableWithStateMachineBehavior')) {
            $schema = <<<EOF
<database name="state_machine_behavior" defaultIdMethod="native">
    <table name="table_with_state_machine_behavior">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />

        <behavior name="state_machine">
            <parameter name="states" value="draft, unpublished, published" />

            <parameter name="initial_state" value="draft" />

            <parameter name="transition" value="draft to published with publish" />
            <parameter name="transition" value="published to unpublished with unpublish" />
            <parameter name="transition" value="unpublished to published with publish" />

            <parameter name="state_column" value="state" />
        </behavior>
    </table>
    <table name="table_with_state_machine_behavior_with_custom_column">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />

        <behavior name="state_machine">
            <parameter name="states" value="draft, published, not_yEt_published, flagged" />

            <parameter name="initial_state" value="draft" />

            <parameter name="transition" value="draft to published with publish" />
            <parameter name="transition" value="published to not_yet_published with unpublish" />
            <parameter name="transition" value="not_yEt_published to published with publish" />
            <parameter name="transition" value="not_yEt_published to flagged with flag_for_publish" />
            <parameter name="transition" value="flagged to published with publish" />

            <parameter name="state_column" value="my_state" />
        </behavior>
    </table>
</database>
EOF;
            $builder = new QuickBuilder();
            $config = $builder->getConfig();
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $builder->build();
        }
    }
开发者ID:smolowik,项目名称:StateMachineBehavior,代码行数:46,代码来源:StateMachineBehaviorTest.php

示例2: 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


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