Skip to content
Permalink
Browse files

Empty translation entity fix.

  • Loading branch information...
robertpustulka committed Jun 17, 2015
1 parent 40eeefc commit ec564bf2608449841b4a3880e20ac9ed325a8a60
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/ORM/Behavior/Translate/TranslateTrait.php
@@ -14,7 +14,7 @@
*/
namespace Cake\ORM\Behavior\Translate;
use Cake\ORM\Entity;
use Cake\Datasource\EntityInterface;
/**
* Contains a translation method aimed to help managing multiple translations
@@ -46,8 +46,10 @@ public function translation($language)
$created = true;
}
if ($created || empty($i18n[$language]) || !($i18n[$language] instanceof Entity)) {
$i18n[$language] = new Entity();
if ($created || empty($i18n[$language]) || !($i18n[$language] instanceof EntityInterface)) {
$className = get_class($this);
$i18n[$language] = new $className;
$created = true;
}

0 comments on commit ec564bf

Please sign in to comment.
You can’t perform that action at this time.