3 namespace wcf\system\database\table\column
;
6 * Represents a column of a database table.
8 * @author Matthias Schmidt
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Database\Table\Column
14 interface IDatabaseTableColumn
17 * Marks the column to be dropped and returns the column.
21 public function drop(): static;
24 * Returns the data used by `DatabaseEditor` to add the column to a table.
26 public function getData(): array;
29 * Returns the name of the column.
31 public function getName(): string;
34 * Returns the new name of the column or `null` if the column's name is unchanged.
38 public function getNewName(): ?
string;
41 * Returns the type of the column.
43 public function getType(): string;
46 * Returns `true` if the values of the column cannot be `null`.
48 public function isNotNull(): bool;
51 * Sets the name of the column and returns the column.
55 public function name(string $name): static;
58 * Sets if the values of the column cannot be `null`.
62 public function notNull(bool $notNull = true): static;
65 * Sets the new name of the column and returns the column.
70 public function renameTo(string $newName): static;
73 * Returns `true` if the column will be dropped.
75 public function willBeDropped(): bool;
78 * Returns a `DatabaseTableColumn` object with the given name.
82 public static function create(string $name): static;
85 * Returns a `DatabaseTableColumn` object with the given name and data.
87 * @param array $data data returned by `DatabaseEditor::getColumns()`
90 public static function createFromData(string $name, array $data): static;