PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Infrastructure / WP / InstallActions / DB / Booking / EventsTable.php
ameliabooking / src / Infrastructure / WP / InstallActions / DB / Booking Last commit date
AppointmentsTable.php 1 year ago CustomerBookingToEventsTicketsTable.php 2 years ago CustomerBookingsTable.php 1 year ago CustomerBookingsToEventsPeriodsTable.php 2 years ago CustomerBookingsToExtrasTable.php 2 years ago EventsPeriodsTable.php 1 year ago EventsProvidersTable.php 2 years ago EventsTable.php 1 year ago EventsTagsTable.php 2 years ago EventsTicketsTable.php 1 year ago
EventsTable.php
92 lines
1 <?php
2
3 namespace AmeliaBooking\Infrastructure\WP\InstallActions\DB\Booking;
4
5 use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;
6 use AmeliaBooking\Domain\ValueObjects\String\Color;
7 use AmeliaBooking\Domain\ValueObjects\String\Name;
8 use AmeliaBooking\Infrastructure\WP\InstallActions\DB\AbstractDatabaseTable;
9 use AmeliaBooking\Domain\ValueObjects\String\Description;
10
11 /**
12 * Class EventsTable
13 *
14 * @package AmeliaBooking\Infrastructure\WP\InstallActions\DB\Booking
15 */
16 class EventsTable extends AbstractDatabaseTable
17 {
18
19 const TABLE = 'events';
20
21 /**
22 * @return string
23 * @throws InvalidArgumentException
24 */
25 public static function buildTable()
26 {
27 $table = self::getTableName();
28
29 $name = Name::MAX_LENGTH;
30 $description = Description::MAX_LENGTH;
31 $color = Color::MAX_LENGTH;
32
33 return "CREATE TABLE {$table} (
34 `id` INT(11) NOT NULL AUTO_INCREMENT,
35 `parentId` bigint(20),
36 `name` varchar({$name}) NOT NULL default '',
37 `status` ENUM('approved','pending','canceled','rejected') NOT NULL,
38 `bookingOpens` DATETIME NULL,
39 `bookingCloses` DATETIME NULL,
40 `bookingOpensRec` ENUM('same', 'calculate') DEFAULT 'same',
41 `bookingClosesRec` ENUM('same', 'calculate') DEFAULT 'same',
42 `ticketRangeRec` ENUM('same', 'calculate') DEFAULT 'calculate',
43 `recurringCycle` ENUM('daily', 'weekly', 'monthly', 'yearly') NULL,
44 `recurringOrder` int(11) NULL,
45 `recurringInterval` int(11) DEFAULT 1,
46 `recurringMonthly` ENUM('each' , 'on') DEFAULT 'each',
47 `monthlyDate` DATETIME NULL,
48 `monthlyOnRepeat` ENUM('first', 'second', 'third', 'fourth', 'fifth', 'last') DEFAULT NULL,
49 `monthlyOnDay` ENUM('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday') DEFAULT NULL,
50 `recurringUntil` DATETIME NULL,
51 `maxCapacity` int(11) NOT NULL,
52 `maxCustomCapacity` int(11) NULL DEFAULT NULL,
53 `maxExtraPeople` int(11) NULL DEFAULT NULL,
54 `price` double NOT NULL,
55 `locationId` bigint(20) NULL,
56 `customLocation` VARCHAR({$name}) NULL,
57 `description` TEXT({$description}) NULL,
58 `color` varchar({$color}) NULL NULL,
59 `show` TINYINT(1) NOT NULL DEFAULT 1,
60 `notifyParticipants` TINYINT(1) NOT NULL,
61 `created` DATETIME NOT NULL,
62 `settings` text({$description}) NULL DEFAULT NULL,
63 `zoomUserId` varchar({$name}) DEFAULT NULL,
64 `bringingAnyone` TINYINT(1) NULL DEFAULT 1,
65 `bookMultipleTimes` TINYINT(1) NULL DEFAULT 1,
66 `translations` TEXT NULL DEFAULT NULL,
67 `depositPayment` ENUM('disabled' , 'fixed', 'percentage') DEFAULT 'disabled',
68 `depositPerPerson` TINYINT(1) DEFAULT 1,
69 `fullPayment` TINYINT(1) DEFAULT 0,
70 `deposit` double DEFAULT 0,
71 `customPricing` TINYINT(1) DEFAULT 0,
72 `organizerId` bigint(20) NULL,
73 `closeAfterMin` INT(11) NULL DEFAULT NULL,
74 `closeAfterMinBookings` TINYINT(1) DEFAULT 0,
75 `aggregatedPrice` TINYINT(1) DEFAULT 1,
76 `error` TEXT({$description}) DEFAULT NULL,
77 PRIMARY KEY (`id`)
78 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
79 }
80
81 /**
82 * @return array
83 * @throws InvalidArgumentException
84 */
85 public static function alterTable()
86 {
87 $table = self::getTableName();
88
89 return ["ALTER TABLE {$table} MODIFY recurringInterval int(11) DEFAULT 1"];
90 }
91 }
92