SplSubject
The table gateway.
public static pq\Connection $defaultConnection
A default connection to use.
public static callable
$defaultResolver as function($table_name)
A callback
whiuch resolves table names to classes.
public static pq\Gateway\Table\CacheInterface $defaultMetadataCache
A default cache implementation. See pq\Gateway\Table\StaticCache.
protected pq\Connection $conn
The PostgreSQL connection.
protected string
$name
The table name.
protected mixed
$rowset = "pq\Gateway\Rowset"
The rowset prototype.
protected pq\Query\WriterInterface $query
A query writer.
protected pq\Query\ExecutorInterface $exec
A query executor.
protected pq\Gateway\Table\Identity $identity
The table identity implementation.
protected pq\Gateway\Table\Attributes $attributes
The table attributes implementation.
protected pq\Gateway\Table\Relations $relations
The table relations implementation.
protected pq\Gateway\Table\CacheInterface $metadataCache
The metadata cache to use for this table.
protected SplObjectStorage
$observers
Table observers.
Create a new table gateway.
void
pq\Gateway\Table::__construct([string
$name = NULL
[, pq\Connection $conn = NULL
]])
Format an identifying postgresql:// URL.
Implements SplSubject
.
pq\Gateway\Table pq\Gateway\Table::attach(SplObserver
$observer)
Find the row inthis table referenced by another table's row by foreign key.
mixed
pq\Gateway\Table::by(pq\Gateway\Row $me[, string
$ref = NULL
])
Create a row in the table.
mixed
pq\Gateway\Table::create([array
$data = NULL
[, string
$returning = "*"]])
Delete rows from the table.
mixed
pq\Gateway\Table::delete(array
$where,[, $returning = NULL
])
Implemnts SplSubject
.
pq\Gateway\Table pq\Gateway\Table::detach(SplObserver
$observer)
Execute the query on behalf of this table.
protected mixed
pq\Gateway\Table::execute(pq\Query\Writer $query)
Find rows in the table.
mixed
pq\Gateway\Table::find([array
$where = NULL
[, string
$order = NULL
[, int
$limit = 0[, int
$offset = 0[, string
$lock = NULL
]]]]])
Retrieve the attributes (columns) of this table.
pq\Gateway\Table\Attributes pq\Gateway\Table::getAttributes()
Retrieve the connection currently in use by the table gateway.
Retrieve the table identity (primary key).
Retrieve the metadata cache used by this table.
pq\Gateway\Table\CacheInterface pq\Gateway\Table::getMetadataCache()
Retrieve the table name.
Retrieve the query executor used by this table.
pq\Query\ExecutorInterface pq\Gateway\Table::getQueryExecutor()
Retrieve the query writer of this table.
Retrieve the foreign key of the table to another table.
pq\Gateway\Table\Reference pq\Gateway\Table::getRelation(string
$table[, string
$ref = NULL
])
Get the relations (by foreign key) of this table.
Retrieve the rowset prototype of this table.
Implements SplSubject
.
void
pq\Gateway\Table::notify([pq\Gateway\Row $row = NULL
[, string
$event = NULL
[, array
&$criteria = NULL
]]])
Find rows in table by foreign key.
mixed
pq\Gateway\Table::of(pq\Gateway\Row $foreign[, string
$ref = NULL
[, string
$order = NULL
[, int
$limit = 0[, int
$offset = 0]]]])
Executor result callback
.
mixed
pq\Gateway\Table::onResult([pq\Result $result = NULL
])
Resolve a table name.
Set the metadata cache implementation.
pq\Gateway\Table pq\Gateway\Table::setMetadataCache(pq\Gateway\Table\CacheInterface $cache)
Set the query executor implementation.
pq\Gateway\Table pq\Gateway\Table::setQueryExecutor(pq\Query\ExecutorInterface $exec)
Set the internal query writer.
pq\Gateway\Table pq\Gateway\Table::setQueryWriter(pq\Query\WriterInterface $query)
Set the prototype of the return value of rowset generating methods.
pq\Gateway\Table pq\Gateway\Table::setRowsetPrototype(mixed
$rowset)
Update rows in the table.
mixed
pq\Gateway\Table::update(array
$where, array
$data[, string
$returning = "*"])
Find rows dependent on other rows by foreign keys.
mixed
pq\Gateway\Table::with(array
$relations[, array
$where = NULL
[, string
$order = NULL
[, int
$limit = 0[, int
$offset = 0]]]])
The table attributes (columns) of a table.
class pq\Gateway\Table\Attributes implements IteratorAggregate
The primary key of a table.
class pq\Gateway\Table\Identity implements Countable
, ITeratorAggregate
Retrieve any relations referenced by the table through foreign keys.
class pq\Gateway\Table\Relations implements Countable
, IteratorAggregate