Class AppointmentResourceHome
java.lang.Object
fr.paris.lutece.plugins.appointment.modules.resource.business.AppointmentResourceHome
Home for appointment resource
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddelete(int nIdAppointment, int nIdAppointmentFormResourceType) Delete an appointment resourcestatic voiddeleteByIdAppointment(int nIdAppointment) Delete appointment resource associated with a given appointmentstatic voiddeleteByIdAppointmentFormResourceType(int nIdAppointmentFormResourceType) Delete appointment resource associated with a given appointment form resource typestatic List<AppointmentResource>findByIdAppointment(int nIdAppointment) Find appointment resource associated with a given appointmentstatic AppointmentResourcefindByPrimaryKey(int nIdAppointment, int nIdAppointmentFormResourceType) Find an appointment resource from its primary keyfindIdAppointmentsByResourceAndDate(String strIdResource, String strResourceType, Date dateMin, Date dateMax) Get the list of id of appointments a resource is associated to between two given datesstatic voidinsert(AppointmentResource resource) Insert a new appointment resourcestatic booleanisResourceAvailable(String strIdResource, String strResourceTypeName, Timestamp nStartingTime, Timestamp nEndingTime) Check if a resource is available for a given period, or if it has already been associated with an appointmentstatic voidupdate(AppointmentResource resource) Update an appointment resource
-
Method Details
-
insert
Insert a new appointment resource- Parameters:
resource- The appointment resource to insert
-
findByPrimaryKey
public static AppointmentResource findByPrimaryKey(int nIdAppointment, int nIdAppointmentFormResourceType) Find an appointment resource from its primary key- Parameters:
nIdAppointment- The id of the appointmentnIdAppointmentFormResourceType- the id of the appointment form resource type- Returns:
- The appointment resource, or null if no appointment resource has the given id
-
findByIdAppointment
Find appointment resource associated with a given appointment- Parameters:
nIdAppointment- the id of the appointment- Returns:
- The list of appointment resource associated with the given appointment, or an empty list if no appointment resource is associated with the appointment
-
update
Update an appointment resource- Parameters:
resource- The appointment resource to update
-
delete
public static void delete(int nIdAppointment, int nIdAppointmentFormResourceType) Delete an appointment resource- Parameters:
nIdAppointment- The id of the appointment of the appointment resourcenIdAppointmentFormResourceType- The id of the appointment form resource type of the appointment resource
-
deleteByIdAppointment
public static void deleteByIdAppointment(int nIdAppointment) Delete appointment resource associated with a given appointment- Parameters:
nIdAppointment- The id of the appointment
-
deleteByIdAppointmentFormResourceType
public static void deleteByIdAppointmentFormResourceType(int nIdAppointmentFormResourceType) Delete appointment resource associated with a given appointment form resource type- Parameters:
nIdAppointmentFormResourceType- The id of the appointment form resource type
-
isResourceAvailable
public static boolean isResourceAvailable(String strIdResource, String strResourceTypeName, Timestamp nStartingTime, Timestamp nEndingTime) Check if a resource is available for a given period, or if it has already been associated with an appointment- Parameters:
strIdResource- The id of the resourcestrResourceTypeName- The type of the resourcenStartingTime- The beginning timenEndingTime- the ending time- Returns:
- True if the resource is available, false otherwise
-
findIdAppointmentsByResourceAndDate
public static List<Integer> findIdAppointmentsByResourceAndDate(String strIdResource, String strResourceType, Date dateMin, Date dateMax) Get the list of id of appointments a resource is associated to between two given dates- Parameters:
strIdResource- The id of the resourcestrResourceType- The resource typedateMin- The minimum datedateMax- the maximum date- Returns:
- The list of ids of appointments
-