Files
ephub/src/Booking/SpotState.php
T

26 lines
631 B
PHP

<?php
declare(strict_types=1);
namespace App\Booking;
/**
* How one resource looks on the floor plan, for the day and span the board is showing.
*
* PARTLY exists because of a real bug: with only "free" and "taken", a desk booked 09:00-13:00
* looked identical to one booked all day on an all-day board, and was equally unclickable -- so
* nobody could book the afternoon without first knowing to narrow the span by hand.
*/
enum SpotState
{
case FREE;
case PARTLY;
case TAKEN;
case MINE;
public function isBookable(): bool
{
return self::FREE === $this || self::PARTLY === $this;
}
}