Browse Source

Breaking out model for conditions

Patrick Conroy 11 years ago
parent
commit
edc9e7f240
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/ORM/Behavior/TranslateBehavior.php

+ 9 - 2
src/ORM/Behavior/TranslateBehavior.php

@@ -110,8 +110,15 @@ class TranslateBehavior extends Behavior
         } else {
             $this->_translationTable = TableRegistry::get($translationAlias);
         }
-
-        $this->config('conditions.model', $this->config('model') ?: $this->config('conditions.model') ?: $this->_table->alias());
+        
+        if ($this->config('model')) {
+            $model = $this->config('model');
+        } elseif ($this->config('conditions.model')) {
+            $model = $this->config('conditions.model');
+        } else {
+            $model = $this->_table->alias();
+        }
+        $this->config('conditions.model', $model);
 
         $this->setupFieldAssociations(
             $this->_config['fields'],