columns, ...$columns); return $this; } /** * Set referenced table and columns.. * @param string $referencedTable Referenced table name. * @param string[] $referencedColumns Referenced columns in table. * @return $this */ public function references(string $referencedTable, string ...$referencedColumns): static { $this->referencedTable = $referencedTable; $this->referencedColumns = $referencedColumns; return $this; } /** * Set action on delete. * @param string $referentialAction Raw action. * @return $this */ public function onDelete(string $referentialAction): static { $this->onDelete = $referentialAction; return $this; } /** * Set action on update. * @param string $referentialAction Raw action. * @return $this */ public function onUpdate(string $referentialAction): static { $this->onUpdate = $referentialAction; return $this; } /** * Create the defined foreign key. * @return void */ public function create(): void { $this->table->getDatabase()->getQueriesAdapter()->createForeignKey($this); } }