ameliabooking
/
src
/
Infrastructure
/
WP
/
InstallActions
/
DB
/
Bookable
/
PackagesServicesTable.php
CategoriesTable.php
2 months ago
CategoriesTableInsertRows.php
6 months ago
ExtrasTable.php
2 months ago
PackagesCustomersServicesTable.php
2 months ago
PackagesCustomersTable.php
2 weeks ago
PackagesServicesLocationsTable.php
2 months ago
PackagesServicesProvidersTable.php
2 months ago
PackagesServicesTable.php
2 months ago
PackagesTable.php
2 months ago
ResourcesTable.php
2 months ago
ResourcesToEntitiesTable.php
2 months ago
ServicesTable.php
2 months ago
ServicesViewsTable.php
2 months ago
PackagesServicesTable.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Infrastructure\WP\InstallActions\DB\Bookable; |
| 4 | |
| 5 | use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException; |
| 6 | use AmeliaBooking\Infrastructure\WP\InstallActions\DB\AbstractDatabaseTable; |
| 7 | |
| 8 | /** |
| 9 | * Class PackagesServicesTable |
| 10 | * |
| 11 | * @package AmeliaBooking\Infrastructure\WP\InstallActions\DB\Bookable |
| 12 | */ |
| 13 | class PackagesServicesTable extends AbstractDatabaseTable |
| 14 | { |
| 15 | public const TABLE = 'packages_to_services'; |
| 16 | |
| 17 | /** |
| 18 | * @return string |
| 19 | * @throws InvalidArgumentException |
| 20 | */ |
| 21 | public static function buildTable() |
| 22 | { |
| 23 | $table = self::getTableName(); |
| 24 | |
| 25 | $charsetCollate = self::getCharsetCollate(); |
| 26 | |
| 27 | return "CREATE TABLE {$table} ( |
| 28 | `id` INT(11) NOT NULL AUTO_INCREMENT, |
| 29 | `serviceId` INT(11) NOT NULL, |
| 30 | `packageId` INT(11) NOT NULL, |
| 31 | `quantity` INT(11) NOT NULL, |
| 32 | `minimumScheduled` INT(5) DEFAULT 1, |
| 33 | `maximumScheduled` INT(5) DEFAULT 1, |
| 34 | `allowProviderSelection` TINYINT(1) DEFAULT 1, |
| 35 | `position` INT(11) DEFAULT 0, |
| 36 | PRIMARY KEY (`id`) |
| 37 | ) {$charsetCollate};"; |
| 38 | } |
| 39 | } |
| 40 |