TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractDataType.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 namespace TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType;
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
23 abstract class AbstractDataType
24 {
30  protected $length = 0;
31 
38  protected $precision = -1;
39 
46  protected $scale = -1;
47 
53  protected $fixed = false;
54 
60  protected $unsigned = false;
61 
67  protected $options = [];
68 
74  protected $values;
75 
79  public function getLength(): int
80  {
81  return $this->length;
82  }
83 
87  public function setLength(int $length)
88  {
89  $this->length = $length;
90  }
91 
95  public function getPrecision(): int
96  {
97  return $this->precision;
98  }
99 
103  public function setPrecision(int $precision)
104  {
105  $this->precision = $precision;
106  }
107 
111  public function getScale(): int
112  {
113  return $this->scale;
114  }
115 
119  public function setScale(int $scale)
120  {
121  $this->scale = $scale;
122  }
123 
127  public function isFixed(): bool
128  {
129  return $this->fixed;
130  }
131 
135  public function setFixed(bool $fixed)
136  {
137  $this->fixed = $fixed;
138  }
139 
143  public function getOptions(): array
144  {
145  return $this->options;
146  }
147 
151  public function setOptions(array $options)
152  {
153  $this->options = $options;
154  }
155 
159  public function isUnsigned(): bool
160  {
161  return $this->unsigned;
162  }
163 
167  public function setUnsigned(bool $unsigned)
168  {
169  $this->unsigned = $unsigned;
170  }
171 
175  public function getValues(): array
176  {
177  return $this->values;
178  }
179 
183  public function setValues(array $values)
184  {
185  $this->values = $values;
186  }
187 }