Overview

Namespaces

  • Alchemy
    • core
      • query
      • schema
    • dialect
    • engine
    • orm
    • tests
    • util
      • promise
  • PHP

Classes

  • Column
  • Foreign
  • ForeignKey
  • Index
  • Table
  • TableElement
  • Overview
  • Namespace
  • Class
  • Tree

Class Table

Represent a table in SQL

Alchemy\core\Element implements Alchemy\core\IElement
Extended by Alchemy\core\schema\Table implements Alchemy\util\promise\IPromisable

Direct known subclasses

Alchemy\orm\ORMTable
Namespace: Alchemy\core\schema
Located at alchemy/core/schema/Table.php
Methods summary
public static array(method_name
# list_promisable_methods( )

Returns an array mapping promisable methods to return types. A promisable method is one that is dependent only on immutable inputs and is guaranteed to return an instance of a certain type.

Returns an array mapping promisable methods to return types. A promisable method is one that is dependent only on immutable inputs and is guaranteed to return an instance of a certain type.

Returns

array(method_name
=> class_name, ...)

Implementation of

Alchemy\util\promise\IPromisable::list_promisable_methods()
public static Alchemy\core\schema\Table
# find( string $name )

Retrieve the table registered for a given name.

Retrieve the table registered for a given name.

Parameters

$name
string
$name

Returns

Alchemy\core\schema\Table
public static
# register_name( mixed $name, mixed $table, mixed $force = false )
public
# __construct( string $type, array $name, array $args = array() )

Object constructor

Object constructor

Parameters

$type
string
$name name of table
$name
array
$columndefs array("name" => Column, "name" => Column, ...)
$args
array
$indexdefs array("name" => Index, "name" => Index, ...)

Overrides

Alchemy\core\Element::__construct()
public
# getColumn( mixed $name )
public
# copy( )

Overrides

Alchemy\core\Element::copy()
public string
# getName( )

Get the table name

Get the table name

Returns

string
public
# getRef( )
public boolean
# hasColumn( string $name )

Return true if the given column exists

Return true if the given column exists

Parameters

$name
string
$name

Returns

boolean
public array
# listColumns( )

List all configured columns

List all configured columns

Returns

array
array(Name => Column, ...)
public array
# listDependancies( )

List names of table I depend on

List names of table I depend on

Returns

array
public array
# listDependants( )

List names of tables that depend on me

List names of tables that depend on me

Returns

array
public array
# listIndexes( )

List all additional column indexes

List all additional column indexes

Returns

array
array(Name => Index, ...)
public Index::PrimaryKey
# getPrimaryKey( )

Get this table's primary key index

Get this table's primary key index

Returns

Index::PrimaryKey
public
# register( mixed $force = false )

Register this Table as canonical for its name

Register this Table as canonical for its name

protected
# resolve( )

Lazy-resolve the whole Table

Lazy-resolve the whole Table

Methods inherited from Alchemy\core\Element
__callStatic(), __clone(), addTag(), addTags(), define(), define_alias(), getDescription(), getID(), getTag(), getType(), get_definition(), listTags(), normalize_arg()
Properties summary
protected static array $registered array()
#
protected mixed $name
#
protected mixed $resolved
#
protected array $args array()
#
protected array $columns array()
#
protected array $indexes array()
#
Properties inherited from Alchemy\core\Element
$id, $tags, $type
API documentation generated by ApiGen 2.8.0