*/ public array $cols = []; /** * @var array */ public array $refs = []; public Engine $engine = Engine::INNODB; public Charset $charset = Charset::UTF8; public Collation $collation = Collation::UTF8_GENERAL_CI; public function existsCol(string $name): bool { return isset($this->cols[$name]); } public function reqCol(string $name): void { if (!$this->existsCol($name)) throw new InvalidArgumentException("Column $name does not exist in schema $this->name."); } public function getCol(string $name): Column { return $this->cols[$name]; } public function existsRef(Schema $other): bool { $otherId = $other->id; // TODO return true; } public function reqRef(Schema $other): void { if (!$this->existsRef($other)) throw new InvalidArgumentException("A reference to $other->name is not defined in $this->name."); } }