PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.11
Booking for Appointments and Events Calendar – Amelia v1.2.11
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 / User / UsersTable.php
ameliabooking / src / Infrastructure / WP / InstallActions / DB / User Last commit date
Provider 3 years ago UsersTable.php 1 year ago WPUsersTable.php 4 years ago
UsersTable.php
69 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
22 const TABLE = 'users';
23
24 /**
25 * @return string
26 * @throws InvalidArgumentException
27 */
28 public static function buildTable()
29 {
30 $table = self::getTableName();
31
32 $name = Name::MAX_LENGTH;
33 $email = Email::MAX_LENGTH;
34 $phone = Phone::MAX_LENGTH;
35 $picture = Picture::MAX_LENGTH;
36 $password = Password::MAX_LENGTH;
37 $description = Description::MAX_LENGTH;
38
39 return "CREATE TABLE {$table} (
40 `id` int(11) NOT NULL AUTO_INCREMENT,
41 `status` ENUM('hidden', 'visible', 'disabled') NOT NULL default 'visible',
42 `type` ENUM('customer', 'provider', 'manager', 'admin') NOT NULL,
43 `externalId` bigint(20) DEFAULT NULL,
44 `firstName` varchar({$name}) NOT NULL DEFAULT '',
45 `lastName` varchar({$name}) NOT NULL DEFAULT '',
46 `email` varchar({$email}) DEFAULT NULL,
47 `birthday` date DEFAULT NULL,
48 `phone` varchar({$phone}) DEFAULT NULL,
49 `gender` ENUM('male', 'female') DEFAULT NULL,
50 `note` text,
51 `description` text NULL DEFAULT NULL,
52 `pictureFullPath` varchar ({$picture}) NULL,
53 `pictureThumbPath` varchar ({$picture}) NULL,
54 `password` varchar ({$password}) NULL,
55 `usedTokens` text NULL,
56 `zoomUserId` varchar({$name}) DEFAULT NULL,
57 `stripeConnect` varchar({$name}) DEFAULT NULL,
58 `countryPhoneIso` varchar(2) DEFAULT NULL,
59 `translations` TEXT NULL DEFAULT NULL,
60 `timeZone` varchar({$name}) DEFAULT NULL,
61 `badgeId` int(11) DEFAULT NULL,
62 `error` TEXT({$description}) NOT NULL DEFAULT '',
63 PRIMARY KEY (`id`),
64 UNIQUE KEY `email` (`email`),
65 UNIQUE KEY `id` (`id`)
66 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;";
67 }
68 }
69