コード例 #1
0
 public function makeUser($user)
 {
     $modelLanguages = array();
     //temp var to store languages
     if (!$user['id'] == null) {
         $this->entity->setId($user['id']);
     }
     $this->entity->setEmail($user['email']);
     $this->entity->setName($user['name']);
     $this->entity->setPassword($this->createPass($user['password']));
     $this->entity->setUrl($user['url']);
     $this->entity->setRole($user['role']);
     //set the languages collection
     foreach ($user['languages'] as $language) {
         $l = new Languages();
         $l->setLanguageName($language);
         $l->setUser($this->entity);
         $modelLanguages[] = $l;
     }
     $this->entity->setLanguages($modelLanguages);
     return $this->entity;
 }
コード例 #2
0
 public function addLanguage(Languages $language)
 {
     $language->setUser($this);
     $this->languages[] = $language;
 }