Namespace and ClassPath rewrites
This commit is contained in:
23
Core/Driver/SQL/Constraint/ForeignKey.class.php
Normal file
23
Core/Driver/SQL/Constraint/ForeignKey.class.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Constraint;
|
||||
|
||||
use Core\Driver\SQL\Strategy\Strategy;
|
||||
|
||||
class ForeignKey extends Constraint {
|
||||
|
||||
private string $referencedTable;
|
||||
private string $referencedColumn;
|
||||
private ?Strategy $strategy;
|
||||
|
||||
public function __construct(string $columnName, string $refTable, string $refColumn, ?Strategy $strategy = NULL) {
|
||||
parent::__construct($columnName);
|
||||
$this->referencedTable = $refTable;
|
||||
$this->referencedColumn = $refColumn;
|
||||
$this->strategy = $strategy;
|
||||
}
|
||||
|
||||
public function getReferencedTable(): string { return $this->referencedTable; }
|
||||
public function getReferencedColumn(): string { return $this->referencedColumn; }
|
||||
public function onDelete(): ?Strategy { return $this->strategy; }
|
||||
}
|
||||
Reference in New Issue
Block a user