Browse Source

updated test to provide even simpler example

everzet 13 years ago
parent
commit
59ed821d12
1 changed files with 6 additions and 14 deletions
  1. 6 14
      tests/Gedmo/Translator/Fixture/Person.php

+ 6 - 14
tests/Gedmo/Translator/Fixture/Person.php

@@ -75,17 +75,14 @@ class Person
     {
         $this->translations = new ArrayCollection();
 
-        $this->initializeTranslator();
+        $this->translate();
     }
 
-    /** @ORM\PrePersist */
-    public function translateEntityToDefaultLocale()
-    {
-        $this->translator->translate();
-    }
-
-    /** @ORM\PostLoad */
-    public function initializeTranslator()
+    /**
+     * @ORM\PrePersist
+     * @ORM\PostLoad
+     */
+    public function translate($locale = null)
     {
         if (null === $this->translator) {
             $this->translator = new ObjectTranslator($this,
@@ -97,11 +94,6 @@ class Person
             return;
         }
 
-        $this->translateEntityToDefaultLocale();
-    }
-
-    public function translate($locale = null)
-    {
         return $this->translator->translate($locale);
     }
 }