本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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.');
}
示例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());
}
示例6: buildClasses
protected function buildClasses($schema)
{
$builder = new QuickBuilder();
$builder->setSchema($schema);
$builder->buildClasses();
}
示例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));
}
}