# yatra/trunk/app/Database/Tables/BaseTable.php

Yatra – Travel Booking &amp; Tour Operator Software, version trunk. 41 lines.

- Page: https://pluginprobe.com/plugins/yatra/trunk/code/app/Database/Tables/BaseTable.php
- Raw: https://pluginprobe.com/plugins/yatra/trunk/raw/app/Database/Tables/BaseTable.php
- Modified: 2026-04-14T03:47:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/trunk/code/app/Database/Tables/BaseTable.php#L10-L20`.

```php
<?php

namespace Yatra\Database\Tables;

/**
 * Base Table Class
 * 
 * Parent class for all database table classes.
 * Handles WordPress prefix and provides common functionality.
 */
abstract class BaseTable
{
    /**
     * Table name without prefix (to be defined in child classes)
     */
    protected static string $table = '';

    /**
     * Get the full table name with WordPress prefix
     */
    public static function getTableName(): string
    {
        global $wpdb;
        return $wpdb->prefix . static::$table;
    }

    /**
     * Get the charset collate for table creation
     */
    public static function getCharsetCollate(): string
    {
        global $wpdb;
        return $wpdb->get_charset_collate();
    }

    /**
     * Get the complete table schema as raw SQL CREATE TABLE statement
     */
    abstract public static function getSchema(): string;
}

```
