Class AppointmentResourceHome

java.lang.Object
fr.paris.lutece.plugins.appointment.modules.resource.business.AppointmentResourceHome

public final class AppointmentResourceHome extends Object
Home for appointment resource
  • Method Details

    • insert

      public static void insert(AppointmentResource resource)
      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 appointment
      nIdAppointmentFormResourceType - the id of the appointment form resource type
      Returns:
      The appointment resource, or null if no appointment resource has the given id
    • findByIdAppointment

      public static List<AppointmentResource> findByIdAppointment(int nIdAppointment)
      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

      public static void update(AppointmentResource resource)
      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 resource
      nIdAppointmentFormResourceType - 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 resource
      strResourceTypeName - The type of the resource
      nStartingTime - The beginning time
      nEndingTime - 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 resource
      strResourceType - The resource type
      dateMin - The minimum date
      dateMax - the maximum date
      Returns:
      The list of ids of appointments