Exemplo n.º 1
0
 /**
  * @name GetAttribute
  * @description Gets all custom attribute definitions for the requested attribute
  * @response CustomAttributeDefinitionResponse
  * @return void
  * @param int $attributeId
  */
 public function GetAttribute($attributeId)
 {
     $attribute = $this->attributeService->GetById($attributeId);
     if ($attribute != null) {
         $this->server->WriteResponse(new CustomAttributeDefinitionResponse($this->server, $attribute));
     } else {
         $this->server->WriteResponse(RestResponse::NotFound(), RestResponse::NOT_FOUND_CODE);
     }
 }
 public function ProcessDataRequest($dataRequest)
 {
     if ($dataRequest == 'load') {
         $referenceNumber = $this->page->GetReferenceNumber();
         $rv = $this->manageReservationsService->LoadByReferenceNumber($referenceNumber, ServiceLocator::GetServer()->GetUserSession());
         $this->page->SetReservationJson($rv);
     }
     if ($dataRequest == 'attribute') {
         $referenceNumber = $this->page->GetReferenceNumber();
         $rv = $this->manageReservationsService->LoadByReferenceNumber($referenceNumber, ServiceLocator::GetServer()->GetUserSession());
         $attributeId = $this->page->GetAttributeId();
         $attribute = $this->attributeService->GetById($attributeId);
         $this->page->ShowAttribute($attribute, $rv->GetAttributeValue($attributeId));
     }
 }