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


PHP PropelQuickBuilder::setConfig方法代码示例

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


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

示例1: setUp

    public function setUp()
    {
        $tables = array('Post' => <<<EOF
<database name="event_dispatcher_behavior" defaultIdMethod="native">
    <table name="post">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" required="true" />

        <behavior name="event_dispatcher" />
    </table>
</database>
EOF
, 'Thread' => <<<EOF
<database name="event_dispatcher_behavior2" defaultIdMethod="native">
    <table name="thread">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="text" type="VARCHAR" required="true" />
        <column name="allowed" type="boolean" required="true" defaultValue="false" />

        <behavior name="event_dispatcher" />
    </table>
</database>
EOF
);
        foreach ($tables as $className => $schema) {
            if (!class_exists($className)) {
                $builder = new PropelQuickBuilder();
                $config = $builder->getConfig();
                $config->setBuildProperty('behavior.event_dispatcher.class', '../src/EventDispatcherBehavior');
                $builder->setConfig($config);
                $builder->setSchema($schema);
                $builder->build();
            }
        }
    }
开发者ID:GoldenLine,项目名称:EventDispatcherBehavior,代码行数:35,代码来源:EventDispatcherBehaviorTest.php

示例2: setUp

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

        <column name="title" type="varchar" size="255" />
        <column name="description" type="longvarchar" />

        <behavior name="lockable">
            <parameter name="apply_to" value="title, description" />
            <parameter name="with_description" value="true" />
        </behavior>
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.visibility.class', '../src/LockableBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $builder->build();
        }
    }
开发者ID:donkeycode,项目名称:propel-lockable-behavior,代码行数:26,代码来源:LockableBehaviorTest.php

示例3: getBuilder

 protected function getBuilder($schema)
 {
     $builder = new PropelQuickBuilder();
     $config = $builder->getConfig();
     $config->setBuildProperty('behavior.equal_nest.class', '../src/EqualNestBehavior');
     $builder->setConfig($config);
     $builder->setSchema($schema);
     return $builder;
 }
开发者ID:VanTanev,项目名称:EqualNestBehavior,代码行数:9,代码来源:TestCase.php

示例4: setUp

    public function setUp()
    {
        $this->schema = <<<EOF
<database name="bookstore" defaultIdMethod="native">
    <table name="typehinted_object">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" size="100" primaryString="true" />
        <column name="roles" type="array" />

        <behavior name="typehintable">
            <parameter name="roles" value="array" />
        </behavior>
    </table>

    <table name="typehinted_user">
        <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true"/>
        <column name="name" type="VARCHAR" size="32"/>
        <column name="catched_exception" type="OBJECT" />
        <column name="foo" type="OBJECT" />

        <behavior name="typehintable">
            <parameter name="typehinted_group" value="BaseTypehintedGroup" />
            <parameter name="catched_exception" value="Exception" />
            <parameter name="foo" value="TypehintedUser" />

            <parameter name="nullable_columns" value="foo, catched_exception" />
        </behavior>
    </table>

    <table name="typehinted_group">
        <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true"/>
        <column name="name" type="VARCHAR" size="32"/>
    </table>

    <table name="typehinted_user_group" isCrossRef="true">
        <column name="user_id" type="INTEGER" primaryKey="true"/>
        <column name="group_id" type="INTEGER" primaryKey="true"/>

        <foreign-key foreignTable="typehinted_user">
            <reference local="user_id" foreign="id"/>
        </foreign-key>
        <foreign-key foreignTable="typehinted_group">
            <reference local="group_id" foreign="id"/>
        </foreign-key>
    </table>
</database>
EOF;
        if (!class_exists('TypehintedObject')) {
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.typehintable.class', __DIR__ . '/../src/TypehintableBehavior');
            $builder->setConfig($config);
            $builder->setSchema($this->schema);
            $builder->build();
        }
    }
开发者ID:ChazalFlorian,项目名称:enjoyPangolin,代码行数:56,代码来源:TypehintableBehaviorTest.php

示例5: simpleBuild

 protected function simpleBuild($SchemaFile, $Namespace)
 {
     $XML = $this->LoadSchema($SchemaFile, $Namespace);
     $builder = new \PropelQuickBuilder();
     $config = $builder->getConfig();
     $config->setBuildProperty('behaviorCacheableClass', 'RickySu\\CacheableBehaviorBundle\\Behavior\\CacheableBehavior');
     $builder->setConfig($config);
     $builder->setSchema($XML);
     $builder->build();
 }
开发者ID:rickysu,项目名称:cacheable-behavior-bundle,代码行数:10,代码来源:Base.php

示例6: setUp

    protected function setUp()
    {
        //begin of setting runtime environments
        $fileSystem = vfsStream::setup();
        $this->className = 'ExampleInstantiator';
        $this->extends = '\\stdClass';
        $this->indention = '  ';
        $this->namespace = 'Test\\Net\\Bazzline\\Propel';
        $this->path = $fileSystem->url();
        $this->prefix = 'create';
        //end of setting runtime environments
        $buildIsNeeded = !class_exists('TableOne') || !class_exists('TableTwo');
        if ($buildIsNeeded) {
            $schema = <<<EOF
<database name="example_database" defaultIdMethod="native">
    <behavior name="add_to_entity_instantiator">
        <parameter name="entity_instantiator_class_name" value="{$this->className}" />
        <parameter name="entity_instantiator_extends" value="{$this->extends}" />
        <parameter name="entity_instantiator_indention" value="{$this->indention}" />
        <parameter name="entity_instantiator_namespace" value="{$this->namespace}" />
        <parameter name="entity_instantiator_path_to_output" value="{$this->path}" />
        <parameter name="entity_method_name_prefix" value="{$this->prefix}" />
        <parameter name="entity_add_to_entity_instantiator" value="true" />
    </behavior>

    <table name="table_one">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
    </table>

    <table name="table_two">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />

        <behavior name="add_to_entity_instantiator">
            <parameter name="entity_add_to_entity_instantiator" value="false" />
        </behavior>
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $configuration = $builder->getConfig();
            $configuration->setBuildProperty('behavior.add_to_entity_instantiator.class', __DIR__ . '/../source/AddToEntityInstantiatorBehavior');
            $builder->setConfig($configuration);
            $builder->setSchema($schema);
            $builder->build();
            //we have to call generate manually since it is called only when php execution is finished
            Manager::getInstance()->generate();
        }
    }
开发者ID:bazzline,项目名称:php_propel_behavior_entity_instantiator,代码行数:48,代码来源:AddToEntityInstantiatorBehaviorTest.php

示例7: setUp

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

        <behavior name="create_entity" />
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $configuration = $builder->getConfig();
            $configuration->setBuildProperty('behavior.create_entity.class', '../source/CreateEntityBehavior');
            $builder->setConfig($configuration);
            $builder->setSchema($schema);
            $builder->build();
        }
    }
开发者ID:bazzline,项目名称:php_propel_behavior_create_entity,代码行数:20,代码来源:CreateEntityBehaviorTest.php

示例8: setUp

    public function setUp()
    {
        if (!class_exists('TestModel')) {
            $schema = <<<EOF
<database name="TestDatabase" defaultIdMethod="native">
    <table name="TestModel">
        <column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true" />
        <column name="email_address" phpName="EmailAddress" type="VARCHAR" size="100" required="true" />
        <behavior name="auditable" />
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.auditable.class', __DIR__ . '/../src/AuditableBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $this->con = $builder->build();
        }
    }
开发者ID:rbfmendiola,项目名称:AuditableBehavior,代码行数:20,代码来源:AuditableBehaviorTest.php

示例9: setUp

    public function setUp()
    {
        if (!class_exists('Author')) {
            $schema = <<<EOF
<database name="bookstore" defaultIdMethod="native">
    <table name="author">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="first_name" type="VARCHAR" size="255" />
        <column name="last_name" type="VARCHAR" size="255" />
        <behavior name="providerBase" />
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.provider_base.class', __DIR__ . '/../src/ProviderBaseBehavior/ProviderBaseBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $con = $builder->build();
        }
    }
开发者ID:emiliomg,项目名称:PropelProviderBehavior,代码行数:21,代码来源:ProviderBehaviorTest.php

示例10: setUp

    public function setUp()
    {
        if (!class_exists('My\\Post')) {
            $schema = <<<EOF
<database name="event_dispatcher_behavior" defaultIdMethod="native" namespace="My">
    <table name="post">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" required="true" />

        <behavior name="event_dispatcher" />
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.event_dispatcher.class', '../src/EventDispatcherBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $builder->build();
        }
    }
开发者ID:GoldenLine,项目名称:EventDispatcherBehavior,代码行数:21,代码来源:EventDispatcherBehaviorWithNamespacesTest.php

示例11: testLoadBehavior

    /**
     * test if issue 425 is resolved
     */
    public function testLoadBehavior()
    {
        $schema = <<<SCHEMA
<database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd"
          name="default" defaultIdMethod="native">
    <table name="dummyTable">
        <behavior name="foobar"/>
        <column name="dummyField1" type="char" size="36" required="true" primaryKey="true" />
        <column name="dummyField2" type="integer" required="true" />
    </table>
</database>
SCHEMA;
        $generatorConfig = new \QuickGeneratorConfig();
        $generatorConfig->setBuildProperty('behaviorFoobarClass', 'Foobar\\Behavior\\Foobar');
        $builder = new \PropelQuickBuilder();
        $builder->setConfig($generatorConfig);
        $builder->setSchema($schema);
        $builder->build();
        $this->assertTrue(class_exists('DummyTable'), 'dummy table class is correctly generated');
    }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:24,代码来源:NamespacedBehaviorTest.php

示例12: setUp

    public function setUp()
    {
        if (!class_exists('Foo')) {
            $schema = <<<EOF
<database name="hstore_behavior" defaultIdMethod="native">
    <table name="foo">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" required="true" />
        <column name="property" type="VARCHAR" required="true" />

        <behavior name="postgres_hstore">
            <parameter name="column_name" value="property" />
        </behavior>
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.postgres_hstore.class', '../src/PostgresHstoreBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $builder->build();
        }
    }
开发者ID:eat24,项目名称:PostgresHstoreBehavior,代码行数:24,代码来源:PostgresHstoreBehaviorTest.php

示例13: getBuilder

 private function getBuilder($schema)
 {
     $builder = new PropelQuickBuilder();
     $config = $builder->getConfig();
     $config->setBuildProperty('behavior.data_cache.class', __DIR__ . '/../src/DataCacheBehavior');
     $builder->setConfig($config);
     $builder->setSchema($schema);
     return $builder;
 }
开发者ID:thefuriouscoder,项目名称:propel2-data-cache-behavior,代码行数:9,代码来源:DataCacheBehaviorTest.php

示例14: setUp


//.........这里部分代码省略.........
        <column name="city" type="VARCHAR" size="100" primaryString="true" />
        <column name="country" type="VARCHAR" size="100" primaryString="true" />

        <behavior name="geocodable">
            <!-- IP -->
            <parameter name="geocode_ip" value="true" />
            <!-- Address -->
            <parameter name="geocode_address" value="true" />
            <parameter name="address_columns" value="street, city, country" />
            <!-- Geocoder -->
            <parameter name="geocoder_api_key" value="YOUR_API_KEY" />
        </behavior>
    </table>

    <table name="geocoded_object_no_autoupdate">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" size="100" primaryString="true" />
        <column name="street" type="VARCHAR" size="100" primaryString="true" />
        <column name="city" type="VARCHAR" size="100" primaryString="true" />
        <column name="country" type="VARCHAR" size="100" primaryString="true" />

        <behavior name="geocodable">
            <parameter name="auto_update" value="false" />
            <!-- IP -->
            <parameter name="geocode_ip" value="true" />
            <!-- Address -->
            <parameter name="geocode_address" value="true" />
            <parameter name="address_columns" value="street, city, country" />
            <!-- Geocoder -->
            <parameter name="geocoder_api_key" value="YOUR_API_KEY" />
        </behavior>
    </table>

    <table name="geocoded_object_key_provider">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" size="100" primaryString="true" />
        <column name="street" type="VARCHAR" size="100" primaryString="true" />
        <column name="city" type="VARCHAR" size="100" primaryString="true" />
        <column name="country" type="VARCHAR" size="100" primaryString="true" />

        <behavior name="geocodable">
            <!-- IP -->
            <parameter name="geocode_ip" value="true" />
            <!-- Address -->
            <parameter name="geocode_address" value="true" />
            <parameter name="address_columns" value="street, city, country" />
            <!-- Geocoder -->
            <parameter name="geocoder_api_key_provider" value="GeoApikeyProvider" />
        </behavior>
    </table>

    <table name="geocoded_object_key_provider_static">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" size="100" primaryString="true" />
        <column name="street" type="VARCHAR" size="100" primaryString="true" />
        <column name="city" type="VARCHAR" size="100" primaryString="true" />
        <column name="country" type="VARCHAR" size="100" primaryString="true" />

        <behavior name="geocodable">
            <!-- IP -->
            <parameter name="geocode_ip" value="true" />
            <!-- Address -->
            <parameter name="geocode_address" value="true" />
            <parameter name="address_columns" value="street, city, country" />
            <!-- Geocoder -->
            <parameter name="geocoder_api_key_provider" value="GeoApikeyProvider::getKey()" />
        </behavior>
    </table>

    <table name="geocoded_object_key_provider_method">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="name" type="VARCHAR" size="100" primaryString="true" />
        <column name="street" type="VARCHAR" size="100" primaryString="true" />
        <column name="city" type="VARCHAR" size="100" primaryString="true" />
        <column name="country" type="VARCHAR" size="100" primaryString="true" />

        <behavior name="geocodable">
            <!-- IP -->
            <parameter name="geocode_ip" value="true" />
            <!-- Address -->
            <parameter name="geocode_address" value="true" />
            <parameter name="address_columns" value="street, city, country" />
            <!-- Geocoder -->
            <parameter name="geocoder_api_key_provider" value="GeoApikeyProvider->getApiKeyMethod()" />
        </behavior>
    </table>
</database>
EOF;
            $builder = new PropelQuickBuilder();
            $config = $builder->getConfig();
            $config->setBuildProperty('behavior.geocodable.class', '../src/GeocodableBehavior');
            $builder->setConfig($config);
            $builder->setSchema($schema);
            $con = $builder->build();
            $con->sqliteCreateFunction('ACOS', 'acos', 1);
            $con->sqliteCreateFunction('COS', 'cos', 1);
            $con->sqliteCreateFunction('RADIANS', 'deg2rad', 1);
            $con->sqliteCreateFunction('SIN', 'sin', 1);
        }
    }
开发者ID:badlamer,项目名称:GeocodableBehavior,代码行数:101,代码来源:GeocodableBehaviorTest.php


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