Ejemplo n.º 1
0
 public function setGroupByName($name, $entityManager)
 {
     if ($name == 'freelancer') {
         $this->setGroup($entityManager->getReference('\\User\\Entity\\UserGroup', UserGroup::FREELANCER_GROUP_ID));
         $freelancer = new Freelancer();
         $freelancer->save($entityManager);
         $this->freelancer = $freelancer;
     } else {
         if ($name == 'employer') {
             $this->setGroup($entityManager->getReference('\\User\\Entity\\UserGroup', UserGroup::EMPLOYER_GROUP_ID));
             $employer = new Employer();
             $employer->setData(['name' => $this->firstName . ', ' . $this->lastName, 'contracted' => 0, 'alias' => $this->getAlias($entityManager, UserGroup::EMPLOYER_GROUP_ID)]);
             $employer->save($entityManager);
             $this->employer = $employer;
         } else {
             if ($name == 'staff') {
                 $this->setGroup($entityManager->getReference('\\User\\Entity\\UserGroup', UserGroup::ADMIN_GROUP_ID));
                 $staff = new Staff();
                 $staff->setData(['name' => $this->firstName . ', ' . $this->lastName, 'alias' => $this->getAlias($entityManager, UserGroup::EMPLOYER_GROUP_ID)]);
                 $staff->save($entityManager);
                 $this->staff = $staff;
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function getData()
 {
     return ['id' => $this->id, 'name' => $this->name, 'is_completed' => $this->is_completed, 'is_client_pool' => $this->is_client_pool, 'is_deleted' => $this->is_deleted, 'is_specialism_pool' => $this->is_specialism_pool, 'language' => $this->language->getData(), 'project' => $this->project->getId(), 'status' => $this->status, 'type' => $this->type, 'dueDate' => $this->dueDate, 'startDate' => $this->startDate, 'total' => $this->total, 'total_freelancer' => $this->total_freelancer, 'assignee' => $this->assignee ? $this->assignee->getData() : null, 'task_number' => $this->task_number, 'currency' => $this->currency];
 }