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 / Location / LocationsTable.php
ameliabooking / src / Infrastructure / WP / InstallActions / DB / Location Last commit date
LocationsTable.php 2 months ago LocationsViewsTable.php 2 months ago
LocationsTable.php
58 lines
1 <?php
2
3 namespace AmeliaBooking\Infrastructure\WP\InstallActions\DB\Location;
4
5 use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;
6 use AmeliaBooking\Domain\ValueObjects\Picture;
7 use AmeliaBooking\Domain\ValueObjects\String\Address;
8 use AmeliaBooking\Domain\ValueObjects\String\Description;
9 use AmeliaBooking\Domain\ValueObjects\String\Name;
10 use AmeliaBooking\Domain\ValueObjects\String\Phone;
11 use AmeliaBooking\Domain\ValueObjects\String\Url;
12 use AmeliaBooking\Infrastructure\WP\InstallActions\DB\AbstractDatabaseTable;
13
14 /**
15 * Class LocationsTable
16 *
17 * @package AmeliaBooking\Infrastructure\WP\InstallActions\DB\Location
18 */
19 class LocationsTable extends AbstractDatabaseTable
20 {
21 public const TABLE = 'locations';
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 $description = Description::MAX_LENGTH;
35 $address = Address::MAX_LENGTH;
36 $phone = Phone::MAX_LENGTH;
37 $picture = Picture::MAX_LENGTH;
38 $url = Url::MAX_LENGTH;
39
40 return "CREATE TABLE {$table} (
41 `id` int(11) NOT NULL AUTO_INCREMENT,
42 `status` ENUM('hidden', 'visible', 'disabled') NOT NULL default 'visible',
43 `name` varchar ({$name}) NOT NULL default '',
44 `description` text({$description}) NULL,
45 `address` varchar ({$address}) NOT NULL,
46 `phone` varchar ({$phone}) NOT NULL,
47 `latitude` decimal(8, 6) NOT NULL,
48 `longitude` decimal(9, 6) NOT NULL,
49 `pictureFullPath` varchar ({$picture}) NULL,
50 `pictureThumbPath` varchar ({$picture}) NULL,
51 `pin` varchar ({$url}) NULL,
52 `translations` TEXT NULL DEFAULT NULL,
53 `countryPhoneIso` varchar(2) DEFAULT NULL,
54 PRIMARY KEY (`id`)
55 ) {$charsetCollate};";
56 }
57 }
58