本文整理匯總了PHP中PropelQuickBuilder::getClasses方法的典型用法代碼示例。如果您正苦於以下問題:PHP PropelQuickBuilder::getClasses方法的具體用法?PHP PropelQuickBuilder::getClasses怎麽用?PHP PropelQuickBuilder::getClasses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PropelQuickBuilder
的用法示例。
在下文中一共展示了PropelQuickBuilder::getClasses方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadAndBuild
protected function loadAndBuild()
{
$this->loadPropelQuickBuilder();
if (!class_exists('Glorpen\\Propel\\PropelBundle\\Tests\\Fixtures\\Model\\Book', false)) {
$builder = new \PropelQuickBuilder();
$builder->getConfig()->setBuildProperty('behaviorEventClass', 'Behaviors.EventBehavior');
$builder->getConfig()->setBuildProperty('behaviorExtendClass', 'Behaviors.ExtendBehavior');
$builder->setSchema(static::$schema);
$builder->setClassTargets(array('tablemap', 'peer', 'object', 'query', 'peerstub', 'querystub'));
file_put_contents("/tmp/a.php", $builder->getClasses());
$builder->build();
$con = new EventPropelPDO('sqlite::memory:');
$con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);
$name = $builder->getDatabase()->getName();
\Propel::setConnection($name, $con, \Propel::CONNECTION_READ);
\Propel::setConnection($name, $con, \Propel::CONNECTION_WRITE);
$builder->buildSQL($con);
}
}
示例2: testVersionColumnNameCaseInsensitivity
public function testVersionColumnNameCaseInsensitivity()
{
$schema = <<<XML
<database name="versionable_behavior_test_case_insensitivity">
<table name="VersionableBehaviorTestCaseInsensitivity">
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
<column name="name" type="varchar" size="64" />
<behavior name="versionable">
<parameter name="version_column" value="Version"/>
</behavior>
</table>
</database>
XML;
$builder = new PropelQuickBuilder();
$builder->setSchema($schema);
$classes = $builder->getClasses();
preg_match_all('/public function getVersion\\(/', $classes, $getterMatches);
preg_match_all('/public function filterByVersion\\(/', $classes, $filterMatches);
// there should be two versions of this getter in the source. one for the main
// class and one for the version class
$this->assertEquals(2, sizeof($getterMatches[0]));
// there should be two versions of the filter. one for the main query class
// and one for the version query class
$this->assertEquals(2, sizeof($filterMatches[0]));
}
開發者ID:kalaspuffar,項目名稱:php-orm-benchmark,代碼行數:26,代碼來源:VersionableBehaviorObjectBuilderModifierTest.php