CarrierDataType
extends DataType
in package
Carrier API specific data types. These are used to optimise the data in the data file.
These data types are internal and are mapped to the DataType::STRING_UTF8 that is exposed to the customer.
Tags
Table of Contents
Constants
- BOOLEAN = 0
- Type boolean
- BYTE = 1
- Type byte
- DOUBLE = 6
- Type double
- FLOAT = 5
- Type float
- INTEGER = 3
- Type int
- LONG = 4
- Type long int
- SHORT = 2
- Type short int
- STRING = 7
- Type string
- STRING_1_BYTE_FIXED = 103
- internal API use
- STRING_2_BYTE_FIXED = 104
- internal API use
- STRING_3_BYTE_FIXED = 105
- internal API use
- STRING_4_BYTE_FIXED = 106
- internal API use
- STRING_5_BYTE_FIXED = 107
- internal API use
- STRING_LEN_BYTE = 100
- internal API use
- STRING_LEN_INT = 102
- internal API use
- STRING_LEN_SHORT = 101
- internal API use
- UNKNOWN = 8
- Unknown type
Properties
- $END_STRING_ID : mixed
- used to quickly find if an ID is a special string type. If we ever add additional IDs that are not sequential we will have to modify this.
- $names : mixed
- Maps data types to data type names array {byte: string}
- $START_STRING_ID : mixed
- used to quickly find if an ID is a special string type. If we ever add additional IDs that are not sequential we will have to modify this.
Methods
- getBaseDataType() : int
- Get the base data type for the given CarrierDataType. This essentially just converts the above special String types to the DataType.String type.
- getName() : string
Constants
BOOLEAN
Type boolean
public
mixed
BOOLEAN
= 0
BYTE
Type byte
public
mixed
BYTE
= 1
DOUBLE
Type double
public
mixed
DOUBLE
= 6
FLOAT
Type float
public
mixed
FLOAT
= 5
INTEGER
Type int
public
mixed
INTEGER
= 3
LONG
Type long int
public
mixed
LONG
= 4
SHORT
Type short int
public
mixed
SHORT
= 2
STRING
Type string
public
mixed
STRING
= 7
STRING_1_BYTE_FIXED
internal API use
public
mixed
STRING_1_BYTE_FIXED
= 103
STRING_2_BYTE_FIXED
internal API use
public
mixed
STRING_2_BYTE_FIXED
= 104
STRING_3_BYTE_FIXED
internal API use
public
mixed
STRING_3_BYTE_FIXED
= 105
STRING_4_BYTE_FIXED
internal API use
public
mixed
STRING_4_BYTE_FIXED
= 106
STRING_5_BYTE_FIXED
internal API use
public
mixed
STRING_5_BYTE_FIXED
= 107
STRING_LEN_BYTE
internal API use
public
mixed
STRING_LEN_BYTE
= 100
STRING_LEN_INT
internal API use
public
mixed
STRING_LEN_INT
= 102
STRING_LEN_SHORT
internal API use
public
mixed
STRING_LEN_SHORT
= 101
UNKNOWN
Unknown type
public
mixed
UNKNOWN
= 8
Properties
$END_STRING_ID
used to quickly find if an ID is a special string type. If we ever add additional IDs that are not sequential we will have to modify this.
private
static mixed
$END_STRING_ID
= self::STRING_5_BYTE_FIXED
$names
Maps data types to data type names array {byte: string}
private
static mixed
$names
= array(self::BOOLEAN => 'Boolean', self::BYTE => 'Byte', self::SHORT => 'Short', self::INTEGER => 'Integer', self::LONG => 'Long', self::FLOAT => 'Float', self::DOUBLE => 'Double', self::STRING => 'String', self::UNKNOWN => 'Unknown')
$START_STRING_ID
used to quickly find if an ID is a special string type. If we ever add additional IDs that are not sequential we will have to modify this.
private
static mixed
$START_STRING_ID
= self::STRING_LEN_BYTE
Methods
getBaseDataType()
Get the base data type for the given CarrierDataType. This essentially just converts the above special String types to the DataType.String type.
public
static getBaseDataType(mixed $dataTypeID) : int
Parameters
- $dataTypeID : mixed
Return values
int —Data type from DataType
getName()
public
static getName( $dataTypeID) : string
Parameters
Return values
string —The name of the data type.