Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
Unsigned Class Reference
Inheritance diagram for Unsigned:
DbDefinitionProcessorInterface

Public Member Functions

 toDefinition (ElementInterface $column)
 
 fromDefinition (array $data)
 

Data Fields

const UNSIGNED_FLAG = 'unsigned'
 

Detailed Description

Unsigned flag processor. Unsigned can be used for all numeric types.

Definition at line 19 of file Unsigned.php.

Member Function Documentation

◆ fromDefinition()

fromDefinition ( array  $data)

Input always will be array of SQL definitions, like: 'type' => 'name VARCHAR(255)'\ 'nullable' => 'no'

Parameters
array$data
Returns
array

Implements DbDefinitionProcessorInterface.

Definition at line 38 of file Unsigned.php.

39  {
40  $data['unsigned'] = stripos($data['definition'], self::UNSIGNED_FLAG) !== false;
41  return $data;
42  }

◆ toDefinition()

toDefinition ( ElementInterface  $column)
Parameters
ColumnUnsignedAwareInterface$columnOutput always will be SQL definition.

Implements DbDefinitionProcessorInterface.

Definition at line 30 of file Unsigned.php.

31  {
32  return $column->isUnsigned() ? strtoupper(self::UNSIGNED_FLAG) : '';
33  }

Field Documentation

◆ UNSIGNED_FLAG

const UNSIGNED_FLAG = 'unsigned'

Unsigned flag. Applicable only to numeric types.

Definition at line 24 of file Unsigned.php.


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