php - Gym Appointments database schema -


i developing gym management app in php / symfony2 / doctrine 2. , developing appointments module. appointment can not single row e event_date( date when going happen ) because continues several day per week several weeks or months. how can design entities keeping tract of appointments displaying them in calendar format, every day of month can view appointments of day?

thank in advance.

an appointment entity should hold information such id, descriptor, start_date, end_date, etc. important thing note "start" , "end," gives appointment flexibility of spanning multiple days/months.

in calendar, if wanted display events start , end date between week of jan. 1 jan. 7, following query builder object:

// in entityrepository appointments  $this->getquerybuilder('a')      ->where('a.startdate between :start , :end')      ->andwhere('a.enddate between :start , :end')      ->setparameters([         "start" => '2016-01-01',         "end"   => '2016-01-07'      ])      ->getquery()      ->getresult(); 

if wanted events of single day , ending same day, need adjust parameters accordingly.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -