Skip to content

Commit

Permalink
Fix referenceOnly bug
Browse files Browse the repository at this point in the history
The propel XML schema definition allows to reference external models,
which then are included the generation of the php source code. The
resulting classes can then be used in the application.

The 'referenceOnly' parameter indicates if the model should be included
in sql schema generation or not.

The current implementation does not check the value of this parameter,
it checks only if it is set. Because of a default value, the current
check evaluates always to true. This causes the sql generation to be
skipped.
  • Loading branch information
michaelknapp committed May 22, 2015
1 parent 8e12750 commit e9e8a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Propel/Generator/Manager/AbstractManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ protected function includeExternalSchemas(\DOMDocument $dom, $srcDir)
// The external schema may have external schemas of its own ; recurs
$this->includeExternalSchemas($externalSchemaDom, $srcDir);
foreach ($externalSchemaDom->getElementsByTagName('table') as $tableNode) {
if ($referenceOnly) {
if ("true" === $referenceOnly) {
$tableNode->setAttribute("skipSql", "true");
}
$databaseNode->appendChild($dom->importNode($tableNode, true));
Expand Down

0 comments on commit e9e8a2f

Please sign in to comment.