TaxesToEntitiesTable.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @copyright © TMS-Plugins. All rights reserved. |
| 4 | * @licence See LICENCE.md for license details. |
| 5 | */ |
| 6 | |
| 7 | namespace AmeliaBooking\Infrastructure\WP\InstallActions\DB\Tax; |
| 8 | |
| 9 | use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException; |
| 10 | use AmeliaBooking\Infrastructure\WP\InstallActions\DB\AbstractDatabaseTable; |
| 11 | |
| 12 | /** |
| 13 | * Class TaxesToEntitiesTable |
| 14 | * |
| 15 | * @package AmeliaBooking\Infrastructure\WP\InstallActions\DB\Tax |
| 16 | */ |
| 17 | class TaxesToEntitiesTable extends AbstractDatabaseTable |
| 18 | { |
| 19 | |
| 20 | const TABLE = 'taxes_to_entities'; |
| 21 | |
| 22 | /** |
| 23 | * @return string |
| 24 | * @throws InvalidArgumentException |
| 25 | */ |
| 26 | public static function buildTable() |
| 27 | { |
| 28 | $table = self::getTableName(); |
| 29 | |
| 30 | return "CREATE TABLE {$table} ( |
| 31 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 32 | `taxId` int(11) NOT NULL, |
| 33 | `entityId` int(11) NOT NULL, |
| 34 | `entityType` ENUM('service', 'extra', 'event', 'package') NOT NULL, |
| 35 | PRIMARY KEY (`id`) |
| 36 | ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci"; |
| 37 | } |
| 38 | } |
| 39 |