Skip to content

Commit

Permalink
[1.6] Fixed incompatibility between classPrefix and Versionable behav…
Browse files Browse the repository at this point in the history
…ior (closes #1334)
  • Loading branch information
fzaninotto committed Apr 6, 2011
1 parent ace4ecc commit e7ee455
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -107,7 +107,7 @@ public function postDelete($builder)
if (!$builder->getPlatform()->supportsNativeDeleteTrigger() && !$builder->getBuildProperty('emulateForeignKeyConstraints')) {
$script = "// emulate delete cascade
{$this->getVersionQueryClassName()}::create()
->filterBy{$this->getActiveRecordClassName()}(\$this)
->filterBy{$this->table->getPhpName()}(\$this)
->delete(\$con);";
return $script;
}
Expand Down Expand Up @@ -225,7 +225,7 @@ public function addVersion(\$con = null)
\$version->set" . $col->getPhpName() . "(\$this->" . strtolower($col->getName()) . ");";
}
$script .= "
\$version->set{$this->getActiveRecordClassName()}(\$this);";
\$version->set{$this->table->getPhpName()}(\$this);";
foreach ($this->behavior->getVersionableFks() as $fk) {
$fkGetter = $this->builder->getFKPhpNameAffix($fk, $plural = false);
$fkVersionColumnName = $fk->getLocalColumnName() . '_version';
Expand Down Expand Up @@ -368,7 +368,7 @@ protected function addGetLastVersionNumber(&$script)
public function getLastVersionNumber(\$con = null)
{
\$v = {$this->getVersionQueryClassName()}::create()
->filterBy{$this->getActiveRecordClassName()}(\$this)
->filterBy{$this->table->getPhpName()}(\$this)
->orderBy{$this->getColumnPhpName()}('desc')
->findOne(\$con);
if (!\$v) {
Expand Down Expand Up @@ -411,7 +411,7 @@ protected function addGetOneVersion(&$script)
public function getOneVersion(\$versionNumber, \$con = null)
{
return {$this->getVersionQueryClassName()}::create()
->filterBy{$this->getActiveRecordClassName()}(\$this)
->filterBy{$this->table->getPhpName()}(\$this)
->filterBy{$this->getColumnPhpName()}(\$versionNumber)
->findOne(\$con);
}
Expand Down

0 comments on commit e7ee455

Please sign in to comment.