Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Real.php
Go to the documentation of this file.
1 <?php
7 
11 
18 class Real extends Column implements
23 {
27  private $precision;
28 
32  private $scale;
33 
37  private $nullable;
38 
42  private $default;
43 
47  private $unsigned;
48 
65  public function __construct(
66  string $name,
67  string $type,
68  Table $table,
69  int $precision,
70  int $scale,
71  bool $nullable = true,
72  bool $unsigned = false,
73  float $default = null,
74  string $comment = null,
75  string $onCreate = null
76  ) {
77  parent::__construct($name, $type, $table, $comment, $onCreate);
78  $this->precision = $precision;
79  $this->scale = $scale;
80  $this->nullable = $nullable;
81  $this->default = $default;
82  $this->unsigned = $unsigned;
83  }
84 
90  public function getPrecision()
91  {
92  return (int)$this->precision;
93  }
94 
100  public function getScale()
101  {
102  return (int)$this->scale;
103  }
104 
110  public function isNullable()
111  {
112  return (bool)$this->nullable;
113  }
114 
121  public function getDefault()
122  {
123  return $this->default;
124  }
125 
131  public function isUnsigned()
132  {
133  return (bool)$this->unsigned;
134  }
135 
139  public function getDiffSensitiveParams()
140  {
141  return [
142  'type' => $this->getType(),
143  'nullable' => $this->isNullable(),
144  'precision' => $this->getPrecision(),
145  'scale' => $this->getScale(),
146  'unsigned' => $this->isUnsigned(),
147  'default' => $this->getDefault(),
148  'comment' => $this->getComment()
149  ];
150  }
151 }
$type
Definition: item.phtml:13
$table
Definition: trigger.php:14
__construct(string $name, string $type, Table $table, int $precision, int $scale, bool $nullable=true, bool $unsigned=false, float $default=null, string $comment=null, string $onCreate=null)
Definition: Real.php:65
if(!isset($_GET['name'])) $name
Definition: log.php:14