Skip to content

Commit

Permalink
Also skip dependants of foreign classes if set (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
suysdavid authored Jun 23, 2020
1 parent f1a0d95 commit 8469a42
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ protected function addColumnAttributeDeclaration(&$script, Column $col) {
* @param Column $col
**/
protected function addColumnAttributeLoaderComment(&$script, Column $col) {
$clo = strtolower($col->getName());
$script .= "
/**
* Whether the lazy-loaded $clo value has been loaded from database.
Expand Down Expand Up @@ -828,6 +829,7 @@ protected function addTemporalAccessorBody(&$script, Column $col) {
";

if($col->isNotNull()) {
$visibility = $col->getAccessorVisibility();
$script .= " }
".$visibility." function getHas$cfc()
Expand Down Expand Up @@ -2718,6 +2720,7 @@ protected function addFKByKeyMutator(&$script, ForeignKey $fk)

#$className = $this->getForeignTable($fk)->getPhpName();
$methodAffix = $this->getFKPhpNameAffix($fk);
$tblFK = $this->getForeignTable($fk);
#$varName = $this->getFKVarName($fk);

$script .= "
Expand Down Expand Up @@ -3236,6 +3239,7 @@ protected function addPKRefFKGet(&$script, ForeignKey $refFK)
$joinedTableObjectBuilder = $this->getNewObjectBuilder($refFK->getTable());
$joinedTablePeerBuilder = $this->getNewObjectBuilder($refFK->getTable());
$className = $joinedTableObjectBuilder->getObjectClassname();
$throwOnNull = $table->getAttribute('throwOnNull', false);

$varName = $this->getPKRefFKVarName($refFK);

Expand Down Expand Up @@ -3390,7 +3394,7 @@ protected function doSave(PropelPDO \$con, \$resolveDependencyProblems = false".
$script .= "
if (\$this->$aVarName !== null) {
if (\$this->".$aVarName."->isModified() || \$this->".$aVarName."->isNew()) {
\$affectedRows += \$this->".$aVarName."->save(\$con, true === \$resolveDependencyProblems ? 'skip-dependants' : false);
\$affectedRows += \$this->".$aVarName."->save(\$con, false !== \$resolveDependencyProblems ? 'skip-dependants' : false);
}
\$this->set".$this->getFKPhpNameAffix($fk, $plural = false)."(\$this->$aVarName);
}
Expand Down

0 comments on commit 8469a42

Please sign in to comment.