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 {
* @var DB
protected $db;
* @param DB $db
public function __construct (DB $db) {
$this->db = $db;
}
* Returns the SQL reference qualifier (i.e. the table name)
*
* @return string
abstract public function __toString ();
* @param string $name
* @return bool
abstract public function offsetExists ($name): bool;
* @return Column
abstract public function offsetGet ($name);
* Throws.
* @param void $name
* @param void $value
* @throws Exception
final public function offsetSet ($name, $value): void {
throw new Exception('Tables are immutable.');
final public function offsetUnset ($name): void {
$this->offsetSet($name, null);