PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.9
Yatra – Travel Booking & Tour Operator Software v3.0.2.9
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / app / Database / Tables / BookingTravellerMetaTable.php

BookingTravellerMetaTable.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.9, at app/Database/Tables/BookingTravellerMetaTable.php

61 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Database\Tables;
4
5 /**
6 * BookingTravellerMeta Table Class
7 *
8 * Represents the booking traveller meta table (wp_yatra_booking_traveller_meta) containing
9 * dynamic metadata fields for individual travelers including personal information,
10 * dietary requirements, medical conditions, and custom fields.
11 *
12 * This table follows the new simplified pattern with only two static methods:
13 * - getTableName(): Returns the prefixed table name
14 * - getSchema(): Returns the complete CREATE TABLE SQL statement
15 *
16 * Usage:
17 * BookingTravellerMetaTable::getTableName() // Returns 'wp_yatra_booking_traveller_meta'
18 * BookingTravellerMetaTable::getSchema() // Returns complete SQL schema
19 *
20 * @package Yatra\Database\Tables
21 * @since 1.0.0
22 */
23 class BookingTravellerMetaTable extends BaseTable
24 {
25 /**
26 * Table name without prefix
27 *
28 * @var string The base table name without WordPress prefix
29 */
30 protected static string $table = 'yatra_new_booking_traveller_meta';
31
32 /**
33 * Get the complete table schema as raw SQL CREATE TABLE statement
34 *
35 * Returns the full SQL schema for the booking traveller meta table using heredoc syntax
36 * for proper IDE syntax highlighting. Includes all columns, indexes,
37 * and constraints from the original Database.php schema.
38 *
39 * @return string Complete CREATE TABLE SQL statement
40 */
41 public static function getSchema(): string
42 {
43 $tableName = static::getTableName();
44 $charsetCollate = static::getCharsetCollate();
45
46 return <<<SQL
47 CREATE TABLE IF NOT EXISTS `{$tableName}` (
48 `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
49 `traveller_id` bigint(20) UNSIGNED NOT NULL,
50 `meta_key` varchar(255) NOT NULL,
51 `meta_value` longtext,
52
53 PRIMARY KEY (`id`),
54 KEY `idx_traveller_id` (`traveller_id`),
55 KEY `idx_meta_key` (`meta_key`(191)),
56 UNIQUE KEY `idx_traveller_meta` (`traveller_id`, `meta_key`(191))
57 ) {$charsetCollate} COMMENT='Dynamic metadata for booking travellers';
58 SQL;
59 }
60 }
61