Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DbTypes Class Reference

Manage Databases types. More...

Static Public Member Functions

static isInt ($fieldType)
 
static isString ($fieldType)
 
static isFloat ($fieldType)
 
static isBoolean ($fieldType)
 
static getSize ($dbType)
 
static getType ($dbType)
 
static asPhpType ($dbType)
 

Data Fields

const TYPES
 
const DEFAULT_TYPE ="varchar(30)"
 

Static Protected Member Functions

static get_ ($value, $regex, $pos=1)
 

Static Protected Attributes

static $typeMatch ='@([\s\S]*?)((?:\‍((?:\d)+\‍))*?)$@'
 
static $sizeMatch ='@(?:[\s\S]*?)(?:\‍((\d+)\‍))*?$@'
 
static $intMatch ='@^.*?int.*?((?:\‍((?:\d)+\‍))*?)$@'
 
static $stringMatch ='@^.*?char|text|binary.*?((?:\‍((?:\d)+\‍))*?)$@'
 
static $floatMatch ='@^.*?float|decimal|numeric|double.*?((?:\‍((?:\d)+\‍))*?)$@'
 

Detailed Description

Manage Databases types.

Ubiquity\db\utils$DbTypes This class is part of Ubiquity

Author
jc
Version
1.0.1

Definition at line 14 of file DbTypes.php.

Member Function Documentation

◆ asPhpType()

static asPhpType (   $dbType)
static

Definition at line 65 of file DbTypes.php.

◆ get_()

static get_ (   $value,
  $regex,
  $pos = 1 
)
staticprotected

Definition at line 31 of file DbTypes.php.

◆ getSize()

static getSize (   $dbType)
static

Definition at line 57 of file DbTypes.php.

◆ getType()

static getType (   $dbType)
static

Definition at line 61 of file DbTypes.php.

◆ isBoolean()

static isBoolean (   $fieldType)
static

Definition at line 53 of file DbTypes.php.

◆ isFloat()

static isFloat (   $fieldType)
static

Definition at line 49 of file DbTypes.php.

◆ isInt()

static isInt (   $fieldType)
static

Definition at line 41 of file DbTypes.php.

◆ isString()

static isString (   $fieldType)
static

Definition at line 45 of file DbTypes.php.

Field Documentation

◆ $floatMatch

$floatMatch ='@^.*?float|decimal|numeric|double.*?((?:\‍((?:\d)+\‍))*?)$@'
staticprotected

Definition at line 28 of file DbTypes.php.

◆ $intMatch

$intMatch ='@^.*?int.*?((?:\‍((?:\d)+\‍))*?)$@'
staticprotected

Definition at line 26 of file DbTypes.php.

◆ $sizeMatch

$sizeMatch ='@(?:[\s\S]*?)(?:\‍((\d+)\‍))*?$@'
staticprotected

Definition at line 25 of file DbTypes.php.

◆ $stringMatch

$stringMatch ='@^.*?char|text|binary.*?((?:\‍((?:\d)+\‍))*?)$@'
staticprotected

Definition at line 27 of file DbTypes.php.

◆ $typeMatch

$typeMatch ='@([\s\S]*?)((?:\‍((?:\d)+\‍))*?)$@'
staticprotected

Definition at line 24 of file DbTypes.php.

◆ DEFAULT_TYPE

const DEFAULT_TYPE ="varchar(30)"

Definition at line 22 of file DbTypes.php.

◆ TYPES

const TYPES
Initial value:
=["tinyint"=>0,"int"=>0,"decimal"=>0,"float"=>0,"double"=>0,"smallint"=>0,"mediumint"=>0,"bigint"=>0,
"date"=>"NULL","time"=>"NULL","datetime"=>"CURRENT_TIMESTAMP","timestamp"=>"CURRENT_TIMESTAMP","year"=>"'0000'",
"tinytext"=>"NULL","text"=>"NULL","mediumtext"=>"NULL","longtext"=>"NULL",
"tinyblob"=>"NULL","blob"=>"NULL","mediumblob"=>"NULL","longblob"=>"NULL",
"char"=>"NULL","varchar"=>"NULL","binary"=>"NULL","varbinary"=>"NULL",
"enum"=>"''","set"=>"''"
]

Definition at line 15 of file DbTypes.php.


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