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->sqlis not set -
public function getSql(): arrayGet the stored sql queries -
public function get_root_dir(): stringGet path to the root of a BigDb library. -
public function get_db_name(): stringGet a name for the BigDbServer to reference.