for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helix\DB;
use ArrayAccess;
use Exception;
use Helix\DB;
/**
* Uses `ArrayAccess` to produce {@link Column} instances.
*/
abstract class AbstractTable implements ArrayAccess {
* Returns the SQL reference qualifier (i.e. the table name)
*
* @return string
abstract public function __toString ();
* @param int|string $column
* @return null|Column
abstract public function offsetGet ($column);
* @var DB
protected $db;
* @param DB $db
public function __construct (DB $db) {
$this->db = $db;
}
* @return bool
public function offsetExists ($column): bool {
return $this->offsetGet($column) !== null;
* Throws.
* @param void $offset
* @param void $value
* @throws Exception
final public function offsetSet ($offset, $value): void {
throw new Exception('Tables are immutable.');
* @param void $name
final public function offsetUnset ($name): void {
$this->offsetSet($name, null);