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

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -