fr.paris.lutece.plugins.appointment.business.calendar
Class AppointmentSlotHome

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.business.calendar.AppointmentSlotHome

public final class AppointmentSlotHome
extends Object

Home for appointment slots


Method Summary
static void create(AppointmentSlot slot)
          Create a new appointment slot
static void delete(int nIdSlot)
          Remove an appointment slot from its id
static void deleteAllByIdForm(int nIdForm)
          Remove appointment slots associated with a given form.
static void deleteByIdDay(int nIdDay)
          Remove an appointment slot associated with a given day
static void deleteByIdForm(int nIdForm)
          Remove appointment slots associated with a given form.
static void deleteByIdFormAndDayOfWeek(int nIdForm, int nDayOfWeek)
          Delete every slots associated with a given form and a given day of week
static void deleteOldSlots(Date dateMonday)
          Delete every slots that are associated with a day before a given day.
static List<AppointmentSlot> findByIdDay(int nIdDay)
          Find every slots associated with a given day
static List<AppointmentSlot> findByIdDayWithFreePlaces(int nIdDay)
          Get the list of slots associated with a given day, and compute for each slot the number of free places
static List<AppointmentSlot> findByIdForm(int nIdForm)
          Find every slots associated with a given form and not associated with any day
static List<AppointmentSlot> findByIdFormAndDayOfWeek(int nIdForm, int nDayOfWeek)
          Get the list of slots associated with a given form for a given day of week.
static List<AppointmentSlot> findByIdFormWithFreePlaces(int nIdForm, int nDayOfWeek, Date dateDay)
          Get the list of slots associated with a given form for a given day of week.
static AppointmentSlot findByPrimaryKey(int nIdSlot)
          Find a slot from its primary key
static AppointmentSlot findByPrimaryKeyWithFreePlaces(int nIdSlot, Date date)
          Find a slot from its primary key
static void update(AppointmentSlot slot)
          Update an appointment slot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static void create(AppointmentSlot slot)
Create a new appointment slot

Parameters:
slot - The appointment slot to create

update

public static void update(AppointmentSlot slot)
Update an appointment slot

Parameters:
slot - The appointment slot to update

delete

public static void delete(int nIdSlot)
Remove an appointment slot from its id

Parameters:
nIdSlot - The id of the slot to remove

deleteByIdDay

public static void deleteByIdDay(int nIdDay)
Remove an appointment slot associated with a given day

Parameters:
nIdDay - The id of the day to remove slots from

deleteAllByIdForm

public static void deleteAllByIdForm(int nIdForm)
Remove appointment slots associated with a given form. Slots that are associated with a day are also removed

Parameters:
nIdForm - The id of the form to remove slots from

deleteByIdForm

public static void deleteByIdForm(int nIdForm)
Remove appointment slots associated with a given form. Slots that are associated with a day are NOT removed

Parameters:
nIdForm - The id of the form to remove slots from

deleteByIdFormAndDayOfWeek

public static void deleteByIdFormAndDayOfWeek(int nIdForm,
                                              int nDayOfWeek)
Delete every slots associated with a given form and a given day of week

Parameters:
nIdForm - The id of the form
nDayOfWeek - The day of the week

deleteOldSlots

public static void deleteOldSlots(Date dateMonday)
Delete every slots that are associated with a day before a given day.

Parameters:
dateMonday - The date of the day to remove slots

findByPrimaryKey

public static AppointmentSlot findByPrimaryKey(int nIdSlot)
Find a slot from its primary key

Parameters:
nIdSlot - the id of the slot to remove
Returns:
The appointment slot

findByPrimaryKeyWithFreePlaces

public static AppointmentSlot findByPrimaryKeyWithFreePlaces(int nIdSlot,
                                                             Date date)
Find a slot from its primary key

Parameters:
nIdSlot - the id of the slot to remove
date - The date of the day of the slot
Returns:
The appointment slot

findByIdForm

public static List<AppointmentSlot> findByIdForm(int nIdForm)
Find every slots associated with a given form and not associated with any day

Parameters:
nIdForm - the id of the form
Returns:
The list of slots

findByIdDay

public static List<AppointmentSlot> findByIdDay(int nIdDay)
Find every slots associated with a given day

Parameters:
nIdDay - the id of the day
Returns:
The list of slots

findByIdFormAndDayOfWeek

public static List<AppointmentSlot> findByIdFormAndDayOfWeek(int nIdForm,
                                                             int nDayOfWeek)
Get the list of slots associated with a given form for a given day of week.

Parameters:
nIdForm - the if of the form
nDayOfWeek - The day of the week (1 for Monday, 2 for Tuesday, ...)
Returns:
the list of slots

findByIdDayWithFreePlaces

public static List<AppointmentSlot> findByIdDayWithFreePlaces(int nIdDay)
Get the list of slots associated with a given day, and compute for each slot the number of free places

Parameters:
nIdDay - The id of the day
Returns:
The list of slots

findByIdFormWithFreePlaces

public static List<AppointmentSlot> findByIdFormWithFreePlaces(int nIdForm,
                                                               int nDayOfWeek,
                                                               Date dateDay)
Get the list of slots associated with a given form for a given day of week. Also compute the number of free places for each slot

Parameters:
nIdForm - the if of the form
nDayOfWeek - The day of the week (1 for Monday, 2 for Tuesday, ...)
dateDay - The date of the day
Returns:
the list of slots


Copyright © 2014 Mairie de Paris. All Rights Reserved.