Beispiel #1
0
 public function execute()
 {
     $this->area->setName($this->name);
     $this->area->setTerritory($this->territory);
     $this->area->setPercentCompleteness($this->percentCompleteness);
     $this->area->setCustomData($this->customData);
     $this->repository->update($this->area);
 }
Beispiel #2
0
 public static function newArea(Project $project, Territory $territory, AreaStatus $status, $name)
 {
     $item = new Area();
     $item->setProject($project);
     $item->setTerritory($territory);
     $item->setStatus($status);
     $item->setName($name);
     return $item;
 }
Beispiel #3
0
 public function approve(Connection $conn, MembershipRoleResolver $resolver)
 {
     $this->status = $conn->fetchColumn('SELECT `status` FROM `' . CoreTables::AREA_REQUEST_TBL . '` WHERE `id` = :id', [':id' => $this->id]);
     if ($this->status == self::STATUS_VERIFICATION) {
         $this->lastUpdatedAt = time();
         $this->status = self::STATUS_APPROVED;
         $conn->update(CoreTables::AREA_REQUEST_TBL, ['lastUpdatedAt' => $this->lastUpdatedAt, 'status' => $this->status], ['id' => $this->getId()]);
         $area = new Area();
         $area->setName($this->name);
         $area->setProject($this->project);
         $area->setTerritory($this->territory);
         $area->setReporter($this->requestor);
         // oops, naming inconsistency
         $id = $area->insert($conn);
         $conn->update(CoreTables::AREA_REQUEST_TBL, ['areaId' => $id], ['id' => $this->getId()]);
         $area->joinMember($conn, $this->requestor, $resolver->getHighestRole('Area'), '');
         return $area;
     }
     return false;
 }