1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace BotKit\Tools;
- // Колонка для генератора кода
- class ModelGeneratorColumn {
- private string $name;
- private bool $is_primary;
- private string $comment;
- private bool $is_nullable;
- public function __construct($name, $is_primary, $comment, $is_nullable) {
- $this->name = $name;
- $this->is_primary = $is_primary;
- $this->comment = $comment;
- $this->is_nullable = $is_nullable;
- }
- public function isPrimary() : bool {
- return $this->is_primary;
- }
- public function isNullable(): bool {
- return $this->is_nullable;
- }
- // Возвращает название колонки, но добавляет знак доллара перед ним
- public function getNameAsVariable() : string {
- return '$'.$this->name;
- }
- public function getName() : string {
- return $this->name;
- }
- public function getComment() : string {
- return $this->comment;
- }
- }
|