Element_OphTrOperationbooking_ScheduleOperation::validateNoBookingCollision PHP Method

validateNoBookingCollision() public method

Ensure that if there is a current booking on this event, the patient unavailables dates don't collide with the booking.
public validateNoBookingCollision ( $attribute, $params )
$attribute
$params
    public function validateNoBookingCollision($attribute, $params)
    {
        if ($booking = $this->getCurrentBooking()) {
            if (!$this->isPatientAvailable($booking->session_date)) {
                $this->addError($attribute, 'Cannot set the patient to be unavailable on the day of the current booking.');
            }
        }
    }