PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
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 / User / UsersTable.php
ameliabooking / src / Infrastructure / WP / InstallActions / DB / User Last commit date
Provider 2 months ago UsersTable.php 2 months ago WPUsersTable.php 6 months ago
UsersTable.php
76 lines
1 <?php
2
3 namespace AmeliaBooking\Infrastructure\WP\InstallActions\DB\User;
4
5 use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;
6 use AmeliaBooking\Domain\ValueObjects\Picture;
7 use AmeliaBooking\Domain\ValueObjects\String\Description;
8 use AmeliaBooking\Domain\ValueObjects\String\Email;
9 use AmeliaBooking\Domain\ValueObjects\String\Name;
10 use AmeliaBooking\Domain\ValueObjects\String\Password;
11 use AmeliaBooking\Domain\ValueObjects\String\Phone;
12 use AmeliaBooking\Infrastructure\WP\InstallActions\DB\AbstractDatabaseTable;
13
14 /**
15 * Class UsersTable
16 *
17 * @package AmeliaBooking\Infrastructure\WP\InstallActions\DB\User
18 */
19 class UsersTable extends AbstractDatabaseTable
20 {
21 public const TABLE = 'users';
22
23 /**
24 * @return string
25 * @throws InvalidArgumentException
26 */
27 public static function buildTable()
28 {
29 $table = self::getTableName();
30
31 $charsetCollate = self::getCharsetCollate();
32
33 $name = Name::MAX_LENGTH;
34 $email = Email::MAX_LENGTH;
35 $phone = Phone::MAX_LENGTH;
36 $picture = Picture::MAX_LENGTH;
37 $password = Password::MAX_LENGTH;
38 $description = Description::MAX_LENGTH;
39
40 return "CREATE TABLE {$table} (
41 `id` int(11) NOT NULL AUTO_INCREMENT,
42 `status` ENUM('hidden', 'visible', 'disabled', 'blocked') NOT NULL default 'visible',
43 `type` ENUM('customer', 'provider', 'manager', 'admin') NOT NULL,
44 `externalId` bigint(20) DEFAULT NULL,
45 `firstName` varchar({$name}) NOT NULL DEFAULT '',
46 `lastName` varchar({$name}) NOT NULL DEFAULT '',
47 `email` varchar({$email}) DEFAULT NULL,
48 `birthday` date DEFAULT NULL,
49 `phone` varchar({$phone}) DEFAULT NULL,
50 `gender` ENUM('male', 'female') DEFAULT NULL,
51 `note` text,
52 `description` text NULL DEFAULT NULL,
53 `pictureFullPath` varchar ({$picture}) NULL,
54 `pictureThumbPath` varchar ({$picture}) NULL,
55 `password` varchar ({$password}) NULL,
56 `usedTokens` text NULL,
57 `zoomUserId` varchar({$name}) DEFAULT NULL,
58 `stripeConnect` varchar({$name}) DEFAULT NULL,
59 `countryPhoneIso` varchar(2) DEFAULT NULL,
60 `translations` TEXT NULL DEFAULT NULL,
61 `customFields` TEXT NULL DEFAULT NULL,
62 `timeZone` varchar({$name}) DEFAULT NULL,
63 `appleCalendarId` varchar({$name}) DEFAULT NULL,
64 `employeeAppleCalendar` TEXT NULL DEFAULT NULL,
65 `googleCalendarId` varchar({$name}) DEFAULT NULL,
66 `outlookCalendarId` varchar({$name}) DEFAULT NULL,
67 `badgeId` int(11) DEFAULT NULL,
68 `error` TEXT({$description}) DEFAULT NULL,
69 `show` TINYINT(1) DEFAULT 1,
70 PRIMARY KEY (`id`),
71 UNIQUE KEY `email` (`email`),
72 UNIQUE KEY `id` (`id`)
73 ) {$charsetCollate}";
74 }
75 }
76