-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #81
- Loading branch information
Showing
7 changed files
with
153 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* This file is licensed under MIT License. | ||
* | ||
* Copyright (c) 2023 Ibrahim BinAlshikh | ||
* | ||
* For more information on the license, please visit: | ||
* https://github.com/WebFiori/.github/blob/main/LICENSE | ||
* | ||
*/ | ||
namespace webfiori\database; | ||
|
||
/** | ||
* A class that represents a foreign key. | ||
* | ||
* A foreign key must have an owner table and a source table. The | ||
* source table will contain original values and the owner is simply the table | ||
* that own the key. | ||
* | ||
* @author Ibrahim | ||
*/ | ||
class FK extends webfiori\database\ForeignKey { | ||
/** | ||
* An action that can be performed on update or delete. | ||
* | ||
* @var string | ||
*/ | ||
const SET_NULL = 'set null'; | ||
/** | ||
* An action that can be performed on update or delete. | ||
* | ||
* @var string | ||
*/ | ||
const SET_DEFAULT = 'set default'; | ||
/** | ||
* An action that can be performed on update or delete. | ||
* | ||
* @var string | ||
*/ | ||
const NO_ACTION = 'no action'; | ||
/** | ||
* An action that can be performed on update or delete. | ||
* | ||
* @var string | ||
*/ | ||
const CASCADE = 'cascade'; | ||
/** | ||
* An action that can be performed on update or delete. | ||
* | ||
* @var string | ||
*/ | ||
const RESTRICT = 'restrict'; | ||
public function __construct(string $name = 'key_name', Table $ownerTable = null, Table $sourceTable = null, array $cols = []) { | ||
parent::__construct($name, $ownerTable, $sourceTable, $cols); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* | ||
* @author Ibrahim | ||
* | ||
* @version 1.0 | ||
* @deprecated Use the class FK. | ||
*/ | ||
class ForeignKey { | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters