Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Integer Class Reference
Inheritance diagram for Integer:
Column ElementDiffAwareInterface ColumnUnsignedAwareInterface ColumnNullableAwareInterface ColumnIdentityAwareInterface ColumnDefaultAwareInterface GenericElement ElementInterface TableElementInterface ElementInterface

Public Member Functions

 __construct (string $name, string $type, Table $table, int $padding, bool $nullable=true, bool $unsigned=false, bool $identity=false, int $default=null, string $comment=null, string $onCreate=null)
 
 getPadding ()
 
 isNullable ()
 
 getDefault ()
 
 isUnsigned ()
 
 isIdentity ()
 
 getDiffSensitiveParams ()
 
- Public Member Functions inherited from Column
 __construct (string $name, string $type, Table $table, string $comment=null, string $onCreate=null)
 
 getTable ()
 
 getElementType ()
 
 getOnCreate ()
 
 getComment ()
 
- Public Member Functions inherited from GenericElement
 __construct (string $name, string $type)
 
 getName ()
 
 getType ()
 

Additional Inherited Members

- Data Fields inherited from Column
const TYPE = 'column'
 

Detailed Description

Integer column. Declared in SQL, like INT(11) or BIGINT(20). Where digit is padding, how many zeros should be added before first non-zero digit.

Definition at line 17 of file Integer.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $name,
string  $type,
Table  $table,
int  $padding,
bool  $nullable = true,
bool  $unsigned = false,
bool  $identity = false,
int  $default = null,
string  $comment = null,
string  $onCreate = null 
)

Constructor.

Parameters
string$name
string$type
Table$table
int$padding
bool$nullable
bool$unsigned
bool$identity
float | int$default
string | null$comment
string | null$onCreate@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 63 of file Integer.php.

74  {
75  parent::__construct($name, $type, $table, $comment, $onCreate);
76  $this->nullable = $nullable;
77  $this->default = $default;
78  $this->unsigned = $unsigned;
79  $this->padding = $padding;
80  $this->identity = $identity;
81  }
$type
Definition: item.phtml:13
$table
Definition: trigger.php:14
if(!isset($_GET['name'])) $name
Definition: log.php:14

Member Function Documentation

◆ getDefault()

getDefault ( )

Return default value. Note: default value should be int.

Returns
int | null

Implements ColumnDefaultAwareInterface.

Definition at line 109 of file Integer.php.

110  {
111  return $this->default;
112  }

◆ getDiffSensitiveParams()

getDiffSensitiveParams ( )

Return sensitive params, with respect of which we will compare db and xml For instance, padding => '2' identity => nullSuch params as name, renamedTo, disabled, tableName should be avoided here. As this params are system and must not participate in comparison at all.

Returns
array

Implements ElementDiffAwareInterface.

Definition at line 137 of file Integer.php.

◆ getPadding()

getPadding ( )

Column padding.

Returns
int

Definition at line 88 of file Integer.php.

89  {
90  return $this->padding;
91  }

◆ isIdentity()

isIdentity ( )

Define whether column can be autoincrement or not.

Returns
bool

Implements ColumnIdentityAwareInterface.

Definition at line 129 of file Integer.php.

130  {
131  return $this->identity;
132  }

◆ isNullable()

isNullable ( )

Check whether column can be nullable.

Returns
bool

Implements ColumnNullableAwareInterface.

Definition at line 98 of file Integer.php.

99  {
100  return $this->nullable;
101  }

◆ isUnsigned()

isUnsigned ( )

Check whether element is unsigned or not.

Returns
bool

Implements ColumnUnsignedAwareInterface.

Definition at line 119 of file Integer.php.

120  {
121  return $this->unsigned;
122  }

The documentation for this class was generated from the following file: