Navigation Menu

Skip to content

Commit

Permalink
Breaking out model for conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Conroy committed Feb 4, 2015
1 parent 4fe1b11 commit edc9e7f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ORM/Behavior/TranslateBehavior.php
Expand Up @@ -110,8 +110,15 @@ public function initialize(array $config)
} 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'],
Expand Down

0 comments on commit edc9e7f

Please sign in to comment.