Booking::allowed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 18
nc 1
nop 0
dl 0
loc 20
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Resova\Objects;
4
5
/**
6
 * The basket booking object
7
 * The booking object allows you to manage bookings for a basket.
8
 *
9
 * @codeCoverageIgnore
10
 * @package Resova\Models
11
 */
12
class Booking
13
{
14
    /**
15
     * List of allowed fields
16
     *
17
     * @return array
18
     */
19
    public function allowed(): array
20
    {
21
        return [
22
            'id'             => 'int',    // The unique id for the booking object.
23
            'item'           => 'object', // The item associated with the booking, an instance of the item object.
24
            'time'           => 'object', // The time associated with the booking, an instance of the time object
25
            'booking_date'   => 'string', // The date of the basket booking.
26
            'booking_time'   => 'string', // The time of the basket booking.
27
            'booking_end'    => 'string', // The end time of the basket booking.
28
            'duration'       => 'int',    // The duration of the basket booking.
29
            'total_quantity' => 'int',    // The total quantity of spaces for the basket booking.
30
            'quantities'     => 'array[Quantity]', // The quantities of item pricing categories for this basket booking.
31
            'extras'         => 'array[Extra]', // The item extras for this basket booking.
32
            'price'          => 'float',  // The basket booking subtotal.
33
            'discount'       => 'float',  // The total discount value of the basket.
34
            'fee'            => 'float',  // The fee value of the basket.
35
            'tax'            => 'float',  // The tax value of the basket.
36
            'total'          => 'float',  // The total for the basket.
37
            'questions'      => 'array[Question]', // The item booking questions for this basket booking.
38
            'participants'   => 'array',  // The participants for this basket booking.
39
        ];
40
    }
41
}
42