|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | +/** |
| 5 | + * This file is part of MineAdmin. |
| 6 | + * |
| 7 | + * @link https://www.mineadmin.com |
| 8 | + * @document https://doc.mineadmin.com |
| 9 | + |
| 10 | + * @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE |
| 11 | + */ |
| 12 | + |
| 13 | +namespace Mine\GeneratorCrud\Entity; |
| 14 | + |
| 15 | +use Mine\GeneratorCrud\Enums\TableColumnType; |
| 16 | + |
| 17 | +final class ColumnEntity |
| 18 | +{ |
| 19 | + public function __construct( |
| 20 | + private string $columnName, |
| 21 | + private TableColumnType $columnType, |
| 22 | + private string $columnComment, |
| 23 | + private bool $isNullable, |
| 24 | + private bool $isPrimary, |
| 25 | + private bool $isUnique, |
| 26 | + private bool $isAutoIncrement, |
| 27 | + ) {} |
| 28 | + |
| 29 | + public function getColumnName(): string |
| 30 | + { |
| 31 | + return $this->columnName; |
| 32 | + } |
| 33 | + |
| 34 | + public function setColumnName(string $columnName): void |
| 35 | + { |
| 36 | + $this->columnName = $columnName; |
| 37 | + } |
| 38 | + |
| 39 | + public function getColumnType(): TableColumnType |
| 40 | + { |
| 41 | + return $this->columnType; |
| 42 | + } |
| 43 | + |
| 44 | + public function setColumnType(TableColumnType $columnType): void |
| 45 | + { |
| 46 | + $this->columnType = $columnType; |
| 47 | + } |
| 48 | + |
| 49 | + public function getColumnComment(): string |
| 50 | + { |
| 51 | + return $this->columnComment; |
| 52 | + } |
| 53 | + |
| 54 | + public function setColumnComment(string $columnComment): void |
| 55 | + { |
| 56 | + $this->columnComment = $columnComment; |
| 57 | + } |
| 58 | + |
| 59 | + public function isNullable(): bool |
| 60 | + { |
| 61 | + return $this->isNullable; |
| 62 | + } |
| 63 | + |
| 64 | + public function setIsNullable(bool $isNullable): void |
| 65 | + { |
| 66 | + $this->isNullable = $isNullable; |
| 67 | + } |
| 68 | + |
| 69 | + public function isPrimary(): bool |
| 70 | + { |
| 71 | + return $this->isPrimary; |
| 72 | + } |
| 73 | + |
| 74 | + public function setIsPrimary(bool $isPrimary): void |
| 75 | + { |
| 76 | + $this->isPrimary = $isPrimary; |
| 77 | + } |
| 78 | + |
| 79 | + public function isUnique(): bool |
| 80 | + { |
| 81 | + return $this->isUnique; |
| 82 | + } |
| 83 | + |
| 84 | + public function setIsUnique(bool $isUnique): void |
| 85 | + { |
| 86 | + $this->isUnique = $isUnique; |
| 87 | + } |
| 88 | + |
| 89 | + public function isAutoIncrement(): bool |
| 90 | + { |
| 91 | + return $this->isAutoIncrement; |
| 92 | + } |
| 93 | + |
| 94 | + public function setIsAutoIncrement(bool $isAutoIncrement): void |
| 95 | + { |
| 96 | + $this->isAutoIncrement = $isAutoIncrement; |
| 97 | + } |
| 98 | +} |
0 commit comments