Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Added type-hinting on doAdd crossFK generated functions #766

merged 1 commit into from

4 participants


No description provided.

@willdurand willdurand merged commit faa11d0 into propelorm:master

Should this doAdd method not include the connection?

Because it will call get{$selfRelationNamePlural}() that needs an connection?

Because I now have a issue that it falls back on the default connection where I use an other one.

But I don't really understand why this code is here to prevent an endless loop


could you please open a issue with more information about your schema?

I added a pull request #852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  generator/lib/builder/om/PHP5ObjectBuilder.php
3  generator/lib/builder/om/PHP5ObjectBuilder.php
@@ -4616,6 +4616,7 @@ public function add{$relatedObjectClassName}($crossObjectClassName $crossObjectN
protected function addCrossFKDoAdd(&$script, ForeignKey $refFK, ForeignKey $crossFK)
$relatedObjectClassName = $this->getFKPhpNameAffix($crossFK, $plural = false);
+ $relatedObjectName = $this->getNewStubObjectBuilder($crossFK->getForeignTable())->getClassname();
$selfRelationNamePlural = $this->getFKPhpNameAffix($refFK, $plural = true);
@@ -4632,7 +4633,7 @@ protected function addCrossFKDoAdd(&$script, ForeignKey $refFK, ForeignKey $cros
* @param {$relatedObjectClassName} \${$lowerRelatedObjectClassName} The $lowerRelatedObjectClassName object to add.
- protected function doAdd{$relatedObjectClassName}(\${$lowerRelatedObjectClassName})
+ protected function doAdd{$relatedObjectClassName}({$relatedObjectName} \${$lowerRelatedObjectClassName})
// set the back reference to this object directly as using provided method either results
// in endless loop or in multiple relations
Something went wrong with that request. Please try again.