Dotclear  2.29
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Structure Class Reference

Public Member Functions

 __construct (protected ConnectionInterface $con, protected string $prefix= '')
 
 driver ()
 
 table (string $name)
 
 __get (string $name)
 
 reverse ()
 
 synchronize (Structure $s)
 
 getTables ()
 
 tableExists (string $name)
 

Protected Attributes

 $tables = []
 

Private Member Functions

 fieldsDiffer (array $dst_field, array $src_field)
 
 keysDiffer (string $dst_name, array $dst_fields, string $src_name, array $src_fields)
 
 indexesDiffer (string $dst_name, array $dst_idx, string $src_name, array $src_idc)
 
 referencesDiffer (string $dst_name, array $dst_ref, string $src_name, array $src_ref)
 

Detailed Description

Constructor & Destructor Documentation

__construct ( protected ConnectionInterface  $con,
protected string  $prefix = '' 
)

Constructs a new instance.

Parameters
ConnectionInterface$conThe DB handle
string$prefixThe DB table prefix

Member Function Documentation

driver ( )

Get driver name

Returns
string

Referenced by Utils\dbSchema().

Here is the caller graph for this function:

table ( string  $name)

Set a new table

Parameters
string$nameThe name
Returns
Table The database structure table.

Referenced by Structure\__get(), and Structure\reverse().

Here is the caller graph for this function:

__get ( string  $name)

Gets the specified table (create it if necessary).

Parameters
string$nameThe table name
Returns
Table The database structure table.

References Structure\table().

Here is the call graph for this function:

reverse ( )

Populate AbstractSchema instance from database structure

References Structure\$tables, and Structure\table().

Referenced by Structure\synchronize().

Here is the call graph for this function:

Here is the caller graph for this function:

synchronize ( Structure  $s)

Synchronize this schema taken from database with $schema.

Parameters
Structure$sStructure to synchronize with
Returns
int

References Structure\$tables, Structure\fieldsDiffer(), Structure\getTables(), Structure\indexesDiffer(), Structure\keysDiffer(), Structure\referencesDiffer(), Structure\reverse(), and Structure\tableExists().

Here is the call graph for this function:

getTables ( )

Gets the tables.

Returns
array<string, Table> The tables.

References Structure\$tables.

Referenced by Structure\synchronize().

Here is the caller graph for this function:

tableExists ( string  $name)

Determines if table exists.

Parameters
string$nameThe name
Returns
bool True if table exists, False otherwise.

Referenced by Structure\synchronize().

Here is the caller graph for this function:

fieldsDiffer ( array  $dst_field,
array  $src_field 
)
private

Check if two fields are the same

Parameters
array<string,mixed>$dst_field The destination field
array<string,mixed>$src_field The source field
Returns
bool

Referenced by Structure\synchronize().

Here is the caller graph for this function:

keysDiffer ( string  $dst_name,
array  $dst_fields,
string  $src_name,
array  $src_fields 
)
private

Check if two keys are the same

Parameters
string$dst_nameThe destination name
array<string>$dst_fields The destination fields
string$src_nameThe source name
array<string>$src_fields The source fields
Returns
bool

Referenced by Structure\synchronize().

Here is the caller graph for this function:

indexesDiffer ( string  $dst_name,
array  $dst_idx,
string  $src_name,
array  $src_idc 
)
private

Check if two indexes are the same

Parameters
string$dst_nameThe destination name
array<string,mixed>$dst_idx The destination index
string$src_nameThe source name
array<string,mixed>$src_idc The source idc
Returns
bool

Referenced by Structure\synchronize().

Here is the caller graph for this function:

referencesDiffer ( string  $dst_name,
array  $dst_ref,
string  $src_name,
array  $src_ref 
)
private

Check if two references are the same

Parameters
string$dst_nameThe destination name
array<string,mixed>$dst_ref The destination reference
string$src_nameThe source name
array<string,mixed>$src_ref The source reference
Returns
bool

Referenced by Structure\synchronize().

Here is the caller graph for this function:

Field Documentation

$tables = []
protected

The documentation for this class was generated from the following file: