Exemplo n.º 1
0
 public function ChangeStatus()
 {
     $resourceId = $this->page->GetResourceId();
     $statusId = $this->page->GetStatusId();
     $statusReasonId = $this->page->GetStatusReasonId();
     $statusReason = $this->page->GetNewStatusReason();
     Log::Debug('Changing resource status. ResourceId: %s', $resourceId);
     $resource = $this->resourceRepository->LoadById($resourceId);
     if (empty($statusReasonId) && !empty($statusReason)) {
         $statusReasonId = $this->resourceRepository->AddStatusReason($statusId, $statusReason);
     }
     $resource->ChangeStatus($statusId, $statusReasonId);
     $this->resourceRepository->Update($resource);
 }
 public function Add()
 {
     $statusId = $this->page->GetStatusId();
     $description = $this->page->GetDescription();
     $this->resourceRepository->AddStatusReason($statusId, $description);
 }