Skip to content

mustafakarali/engine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads Build Status

Introduction

A framework for defining recurring windows of availability, and "subtracting" bookings/appointments from them. Has features for multiple windows of availability within one day, automatically 'fixes' overlapping windows, and can enforce padding between bookings.

Example

Lets set the availability window from 9-11am, and 11:30am-4pm

$availability = new Availability(array(
    array(
        'start' => '09:00:00',
        'end' => '11:00:00'
    ),
    array(
        'start' => '11:30:00',
        'end' => '16:00:00'
    ),
));

Now we'll add a booking from 3:30-4pm & get back the adjusted availability

$newAvailability = $availability->addBooking(array(
    'start' => '15:30',
    'end' => '16:00'
));

$newAvailability will show the actual availability is 9-11am, and 11:30-3:30pm:

array(
    array(
        'start' => '09:00:00',
        'end' => '11:00:00'
    ),
    array(
        'start' => '11:30:00',
        'end' => '15:30:00'
    ),
);

About

A "booking engine" for defining recurring windows of availability, and "subtracting" bookings/appointments from them.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%