Schema
extends Component
in package
implements
ISchema
Tags
Table of Contents
Interfaces
Properties
- $name : string
- $dsn : IDsn
- $hashCode : int
- $hashCounter : int
- $join_scheme : array<string|int, mixed>
- $join_scheme_cache_key : string
- $table_manager : TableManager
- $table_names : array<string|int, mixed>
- $table_names_cache_key : string
- A template for the key to be used in caching the names of the tables that are a part of this schema. Template placeholders will be replaced with values in respects of this schema on initialization of this instance
- $tables : ArrayObject
Methods
- __call() : mixed
- __callStatic() : mixed
- __construct() : mixed
- __destruct() : mixed
- __get() : mixed
- buildEntityRelationshipGraph() : mixed
- delete() : IModel
- {@inheritdoc}
- extends() : bool
- getConnection() : IConnection
- Gets a database connection by the data source name described by this schema
- getDatabase() : string
- getDsn() : IDsn
- getInformationSchema() : ISchema
- getName() : string
- {@inheritdoc}
- getReflection() : ReflectionClass
- getRelatedTables() : array<string|int, mixed>
- Gets a list of tables that have a direct relationship with a provided table
- getTable() : ITable
- getTableManager() : TableManager
- getTables() : ArrayObject
- read() : IModel|null
- {@inheritdoc}
- save() : void
- {@inheritdoc}
- tableExists() : bool
- Determines whether or not a table by a particular name exists within this schema.
- update() : IModel
- {@inheritdoc}
- init() : mixed
- {@inheritdoc}
- getTableNames() : array<string|int, mixed>
- Gets a list of the names of the tables that exists within this schema. If the list is empty it will attempt to load it from the information schema associated with schema
- setDsn() : mixed
- setName() : mixed
Properties
$name
protected
string
$name
$dsn
private
IDsn
$dsn
$hashCode
private
int
$hashCode
$hashCounter
private
static int
$hashCounter
= 0
$join_scheme
private
array<string|int, mixed>
$join_scheme
$join_scheme_cache_key
private
string
$join_scheme_cache_key
= 'join_scheme.f5785c35-2cc7-40bf-9439-80eb86adfcc5'
$table_manager
private
TableManager
$table_manager
$table_names
private
array<string|int, mixed>
$table_names
= []
$table_names_cache_key
A template for the key to be used in caching the names of the tables that are a part of this schema. Template placeholders will be replaced with values in respects of this schema on initialization of this instance
private
string
$table_names_cache_key
= "<schema_name>.table_names"
$tables
private
ArrayObject
$tables
Methods
__call()
public
__call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
Tags
__callStatic()
public
static __callStatic(mixed $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : mixed
- $arguments : array<string|int, mixed>
__construct()
public
__construct(string $name, IDsn $dsn) : mixed
Parameters
- $name : string
- $dsn : IDsn
Tags
__destruct()
public
__destruct() : mixed
__get()
public
__get(string $property) : mixed
Parameters
- $property : string
buildEntityRelationshipGraph()
public
buildEntityRelationshipGraph() : mixed
delete()
{@inheritdoc}
public
delete(IModel $model) : IModel
Parameters
- $model : IModel
Tags
Return values
IModelextends()
public
extends(ReflectionClass $reflector) : bool
Parameters
- $reflector : ReflectionClass
Return values
boolgetConnection()
Gets a database connection by the data source name described by this schema
public
getConnection() : IConnection
Return values
IConnection —The database connection to this schema
getDatabase()
public
getDatabase() : string
Tags
Return values
stringgetDsn()
public
getDsn() : IDsn
Return values
IDsngetInformationSchema()
public
getInformationSchema() : ISchema
Tags
Return values
ISchemagetName()
{@inheritdoc}
public
getName() : string
Tags
Return values
stringgetReflection()
public
getReflection() : ReflectionClass
Return values
ReflectionClassgetRelatedTables()
Gets a list of tables that have a direct relationship with a provided table
public
static getRelatedTables(ITable $table) : array<string|int, mixed>
Parameters
- $table : ITable
-
The table to retrieve the related tables for
Return values
array<string|int, mixed> —The set of tables which are directly related to the provided table. Will be empty if the provided table does not have any tables directly related to it
getTable()
public
getTable(string $table_name) : ITable
Parameters
- $table_name : string
Tags
Return values
ITablegetTableManager()
public
getTableManager() : TableManager
Return values
TableManagergetTables()
public
getTables() : ArrayObject
Tags
Return values
ArrayObjectread()
{@inheritdoc}
public
read(string $type, string $id) : IModel|null
Parameters
- $type : string
- $id : string
Tags
Return values
IModel|nullsave()
{@inheritdoc}
public
save(IModel $model) : void
Parameters
- $model : IModel
Tags
tableExists()
Determines whether or not a table by a particular name exists within this schema.
public
tableExists(string $table_name) : bool
Parameters
- $table_name : string
-
The name of the table to check if exists
Tags
Return values
bool —True if the table exists within this schema, false otherwise
update()
{@inheritdoc}
public
update(IModel $model) : IModel
Parameters
- $model : IModel
Tags
Return values
IModelinit()
{@inheritdoc}
protected
init() : mixed
Tags
getTableNames()
Gets a list of the names of the tables that exists within this schema. If the list is empty it will attempt to load it from the information schema associated with schema
private
getTableNames() : array<string|int, mixed>
Return values
array<string|int, mixed>setDsn()
private
setDsn(IDsn $dsn) : mixed
Parameters
- $dsn : IDsn
setName()
private
setName(string $name) : mixed
Parameters
- $name : string