Esempio n. 1
0
 public function GetReservationAttributes(UserSession $userSession, ReservationView $reservationView, $requestedUserId = 0)
 {
     if ($requestedUserId == 0) {
         $requestedUserId = $reservationView->OwnerId;
     }
     $attributes = array();
     $customAttributes = $this->GetByCategory(CustomAttributeCategory::RESERVATION);
     foreach ($customAttributes as $attribute) {
         //			$secondaryCategory = $attribute->SecondaryCategory();
         if ($this->CanReserveFor($userSession, $requestedUserId)) {
             $attributes[] = new Attribute($attribute, $reservationView->GetAttributeValue($attribute->Id()));
         }
     }
     return $attributes;
 }
 public function Bind(IReservationComponentInitializer $initializer)
 {
     $attributes = $this->repository->GetByCategory(CustomAttributeCategory::RESERVATION);
     foreach ($attributes as $attribute) {
         $initializer->AddAttribute($attribute, $this->reservationView->GetAttributeValue($attribute->Id()));
     }
 }