本文整理汇总了PHP中PropelQuickBuilder::buildClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelQuickBuilder::buildClasses方法的具体用法?PHP PropelQuickBuilder::buildClasses怎么用?PHP PropelQuickBuilder::buildClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelQuickBuilder
的用法示例。
在下文中一共展示了PropelQuickBuilder::buildClasses方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertEmptyBuilderOutput
protected function assertEmptyBuilderOutput($schema)
{
$builder = new PropelQuickBuilder();
$builder->setSchema($schema);
ob_start();
$builder->buildClasses();
$output = preg_replace('/[\\r\\n]/', '', ob_get_contents());
ob_end_clean();
$this->assertEquals('', $output);
}
示例2: setUp
public function setUp()
{
if (!class_exists('Foo\\MyClassWithInterface')) {
$schema = <<<EOF
<database name="a-database" namespace="Foo">
\t<table name="my_class_with_interface" interface="MyInterface">
\t\t<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
\t\t<column name="name" type="VARCHAR" />
\t</table>
</database>
EOF;
$builder = new PropelQuickBuilder();
$builder->setSchema($schema);
$builder->buildClasses();
}
}
示例3: testDoInsert
/**
* @expectedException PropelException
*/
public function testDoInsert()
{
if (!class_exists('Unexistent')) {
$schema = <<<EOF
<database name="a-database">
<table name="unexistent">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="name" type="VARCHAR" />
</table>
</database>
EOF;
$builder = new PropelQuickBuilder();
$builder->setSchema($schema);
$builder->buildClasses();
}
$object = new Unexistent();
$object->setName('Foo');
$object->save();
$this->fail('Should not be called');
}
示例4:
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
if (!is_file($autoloadFile = __DIR__ . '/../vendor/autoload.php')) {
throw new \LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?');
}
require $autoloadFile;
if (class_exists('Propel')) {
set_include_path(__DIR__ . '/../vendor/phing/phing/classes' . PATH_SEPARATOR . get_include_path());
$class = new \ReflectionClass('TypehintableBehavior');
$builder = new \PropelQuickBuilder();
$builder->getConfig()->setBuildProperty('behavior.typehintable.class', $class->getFileName());
$builder->setSchema(file_get_contents(__DIR__ . '/../Resources/config/propel/schema.xml'));
$builder->buildClasses();
}