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