PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.31
Booking for Appointments and Events Calendar – Amelia v1.2.31
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 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 1 year ago CustomerBookingsTable.php 1 year ago CustomerBookingsToEventsPeriodsTable.php 1 year ago CustomerBookingsToExtrasTable.php 1 year ago EventsPeriodsTable.php 1 year ago EventsProvidersTable.php 1 year ago EventsTable.php 1 year ago EventsTagsTable.php 1 year ago EventsTicketsTable.php 1 year ago
EventsTable.php
91 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 public const TABLE = 'events';
19
20 /**
21 * @return string
22 * @throws InvalidArgumentException
23 */
24 public static function buildTable()
25 {
26 $table = self::getTableName();
27
28 $name = Name::MAX_LENGTH;
29 $description = Description::MAX_LENGTH;
30 $color = Color::MAX_LENGTH;
31
32 return "CREATE TABLE {$table} (
33 `id` INT(11) NOT NULL AUTO_INCREMENT,
34 `parentId` bigint(20),
35 `name` varchar({$name}) NOT NULL default '',
36 `status` ENUM('approved','pending','canceled','rejected') NOT NULL,
37 `bookingOpens` DATETIME NULL,
38 `bookingCloses` DATETIME NULL,
39 `bookingOpensRec` ENUM('same', 'calculate') DEFAULT 'same',
40 `bookingClosesRec` ENUM('same', 'calculate') DEFAULT 'same',
41 `ticketRangeRec` ENUM('same', 'calculate') DEFAULT 'calculate',
42 `recurringCycle` ENUM('daily', 'weekly', 'monthly', 'yearly') NULL,
43 `recurringOrder` int(11) NULL,
44 `recurringInterval` int(11) DEFAULT 1,
45 `recurringMonthly` ENUM('each' , 'on') DEFAULT 'each',
46 `monthlyDate` DATETIME NULL,
47 `monthlyOnRepeat` ENUM('first', 'second', 'third', 'fourth', 'fifth', 'last') DEFAULT NULL,
48 `monthlyOnDay` ENUM('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday') DEFAULT NULL,
49 `recurringUntil` DATETIME NULL,
50 `maxCapacity` int(11) NOT NULL,
51 `maxCustomCapacity` int(11) NULL DEFAULT NULL,
52 `maxExtraPeople` int(11) NULL DEFAULT NULL,
53 `price` double NOT NULL,
54 `locationId` bigint(20) NULL,
55 `customLocation` VARCHAR({$name}) NULL,
56 `description` TEXT({$description}) NULL,
57 `color` varchar({$color}) NULL NULL,
58 `show` TINYINT(1) NOT NULL DEFAULT 1,
59 `notifyParticipants` TINYINT(1) NOT NULL,
60 `created` DATETIME NOT NULL,
61 `settings` text({$description}) NULL DEFAULT NULL,
62 `zoomUserId` varchar({$name}) DEFAULT NULL,
63 `bringingAnyone` TINYINT(1) NULL DEFAULT 1,
64 `bookMultipleTimes` TINYINT(1) NULL DEFAULT 1,
65 `translations` TEXT NULL DEFAULT NULL,
66 `depositPayment` ENUM('disabled' , 'fixed', 'percentage') DEFAULT 'disabled',
67 `depositPerPerson` TINYINT(1) DEFAULT 1,
68 `fullPayment` TINYINT(1) DEFAULT 0,
69 `deposit` double DEFAULT 0,
70 `customPricing` TINYINT(1) DEFAULT 0,
71 `organizerId` bigint(20) NULL,
72 `closeAfterMin` INT(11) NULL DEFAULT NULL,
73 `closeAfterMinBookings` TINYINT(1) DEFAULT 0,
74 `aggregatedPrice` TINYINT(1) DEFAULT 1,
75 `error` TEXT({$description}) DEFAULT NULL,
76 PRIMARY KEY (`id`)
77 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
78 }
79
80 /**
81 * @return array
82 * @throws InvalidArgumentException
83 */
84 public static function alterTable()
85 {
86 $table = self::getTableName();
87
88 return ["ALTER TABLE {$table} MODIFY recurringInterval int(11) DEFAULT 1"];
89 }
90 }
91