コード例 #1
0
 /**
  *
  */
 public function __construct($example)
 {
     parent::__construct($example);
     if (isset($example->tr)) {
         foreach ($example->tr as $translation) {
             $this->translations[] = $translation->text;
         }
     }
 }
コード例 #2
0
 /**
  *
  */
 public function __construct($definition)
 {
     parent::__construct($definition);
     if (isset($definition->ts)) {
         $this->transcription = $definition->ts;
     }
     if (isset($definition->tr)) {
         foreach ($definition->tr as $translation) {
             $this->translations[] = new DictionaryTranslation($translation);
         }
     }
 }
コード例 #3
0
 /**
  *
  */
 public function __construct($translation)
 {
     parent::__construct($translation);
     if (isset($translation->syn)) {
         foreach ($translation->syn as $synonym) {
             $this->synonyms[] = new DictionaryBaseItem($synonym);
         }
     }
     if (isset($translation->mean)) {
         foreach ($translation->mean as $meaning) {
             $this->meanings[] = new DictionaryBaseItem($meaning);
         }
     }
     if (isset($translation->ex)) {
         foreach ($translation->ex as $example) {
             $this->examples[] = new DictionaryExample($example);
         }
     }
 }