Skip to content

Commit

Permalink
Fixed CS, added a note to the UPDATE file
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Apr 14, 2012
1 parent 1f5cf64 commit b168e22
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ tests/Fixtures/reverse/mysql/runtime-conf.xml
tests/Fixtures/reverse/pgsql/runtime-conf.xml
tests/Fixtures/schemas/build.properties
vendor/
check_cs
4 changes: 4 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ The classes used by Propel internally to build the object model were renamed. Th
PHP5ObjectBuilder.php ObjectBuilder.php
PHP5PeerBuilder.php PeerBuilder.php
PHP5TableMapBuilder.php TableMapBuilder.php

## Base classes reorganized

Base classes are generated in a `Base` directory, and base classes are no more prefixed by `Base`.
6 changes: 4 additions & 2 deletions src/Propel/Generator/Builder/Om/AbstractOMBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,16 @@ protected function needAliasForClassname($class, $namespace)
if ('' == $namespace && 'Base' == $this->getNamespace()) {
if (str_replace(array('Peer','Query'), '', $class) == str_replace(array('Peer','Query'), '', $this->getUnqualifiedClassname())) {
return true;
} else if ((false !== strpos($class,'Peer') || false !== strpos($class,'Query'))) {
} elseif ((false !== strpos($class,'Peer') || false !== strpos($class,'Query'))) {
return true;
} else if (false === array_search($class, $this->whiteListOfDeclaratedClasses, true)) { //force alias for model without namespace
} elseif (false === array_search($class, $this->whiteListOfDeclaratedClasses, true)) { //force alias for model without namespace

return true;
}
}
if ('Base' == $namespace && '' == $this->getNamespace()) {
if (false === array_search($class, $this->whiteListOfDeclaratedClasses, true)) { //force alias for model without namespace

return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Generator/Builder/Om/PeerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function addClassOpen(&$script)

if (null !== $parentClass) {
$extendingPeerClass = ' extends '.$parentClass;
} else if ('BasePeer' !== $this->basePeerClassname) {
} elseif ('BasePeer' !== $this->basePeerClassname) {
$extendingPeerClass = ' extends '.$this->basePeerClassname;
}

Expand Down
1 change: 1 addition & 0 deletions src/Propel/Runtime/Map/DatabaseMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function getTableByPhpName($phpName)
return $this->tablesByPhpName[$phpName];
} elseif (class_exists($tmClass = $phpName . 'TableMap')) {
$this->addTableFromMapClass($tmClass);

return $this->tablesByPhpName[$phpName];
} elseif (class_exists($tmClass = substr_replace($phpName, '\\Map\\', strrpos($phpName, '\\'), 1) . 'TableMap') ||
class_exists($tmClass = '\\Map\\' .$phpName . 'TableMap')) {
Expand Down

0 comments on commit b168e22

Please sign in to comment.