File src/BigDb.php

class Tlf\BigDb

Extend this class to create an interface for your BigDb library. Provides many convenience methods for various features. Uses 4 traits.
See source code at /src/BigDb.php

Constants

Properties

  • public readonly \PDO $pdo;
  • public \Tlf\LilDb $ldb;
  • protected array $sql; Sql queries, typically from .sql files on disk
  • protected string $orm_namespace; The namespace from which Orm classes should be loaded
  • protected string $db_name; The name used by BigDbServer to identify this BigDb instance. Does NOT correspond to a mysql database. Also, {}@see get_db_name()}
  • public string $root_dir;
  • public string $timezone = 'UTC'; The application's timezone as a DateTimeZone-compatible string, like 'America/Chicago' or 'UTC'

All DateTimes are converted to UTC for database storage bc MySql does not store timezone information.

Methods

  • public function __construct(\PDO $pdo, string $root_dir = null) Construct a BigDb instance and initialize it.

  • protected function init_sql() Initialize the sql statements from the compiled sql file, only if $this->sql is not set

  • public function getSql(): array Get the stored sql queries

  • public function get_root_dir(): string Get path to the root of a BigDb library.

  • public function get_db_name(): string Get a name for the BigDbServer to reference.