Skip to content

Commit

Permalink
Merge pull request #489 from havvg/hotfix/behavior-parentclass
Browse files Browse the repository at this point in the history
fix duplicate use of parentClass from behaviors
  • Loading branch information
willdurand committed Oct 23, 2012
2 parents 65def77 + a9b91e5 commit 9d4763a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions generator/lib/builder/om/PHP5ObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ protected function addClassOpen(&$script)
$tableName = $table->getName();
$tableDesc = $table->getDescription();
$parentClass = $this->getBehaviorContent('parentClass');
$parentClass = (null !== $parentClass) ? $parentClass : ClassTools::classname($this->getBaseClass());
if (null === $parentClass) {
$parentClass = ClassTools::classname($this->getBaseClass());

if (false === strpos($this->getBaseClass(), '.')) {
$this->declareClass($this->getBaseClass());
} else {
$this->declareClass($parentClass);
if (false === strpos($this->getBaseClass(), '.')) {
$this->declareClass($this->getBaseClass());
} else {
$this->declareClass($parentClass);
}
}

if ($this->getBuildProperty('addClassLevelComment')) {
Expand Down

0 comments on commit 9d4763a

Please sign in to comment.