PHP 클래스 CI_DB_forge, TastyIgniter

저자: EllisLab Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$db_char_set string Database character set
$fields array Fields data
$keys array Keys data
$primary_keys array Primary Keys data

보호된 프로퍼티들

프로퍼티 타입 설명
$_create_database string CREATE DATABASE statement
$_create_table string CREATE TABLE statement
$_create_table_if string CREATE TABLE IF statement
$_create_table_keys boolean Whether table keys are created from within the CREATE TABLE statement.
$_default string DEFAULT value representation in CREATE/ALTER TABLE statements
$_drop_database string DROP DATABASE statement
$_drop_table_if string DROP TABLE IF EXISTS statement
$_null string NULL value representation in CREATE/ALTER TABLE statements
$_rename_table string RENAME TABLE statement
$_unsigned boolean | array UNSIGNED support
$db object Database object

공개 메소드들

메소드 설명
__construct ( &$db ) : void Class constructor
add_column ( string $table, array $field, string $_after = NULL ) : boolean Column Add
add_field ( array $field ) : CI_DB_forge Add Field
add_key ( string $key, boolean $primary = FALSE ) : CI_DB_forge Add Key
create_database ( string $db_name ) : boolean Create database
create_table ( string $table, boolean $if_not_exists = FALSE, array $attributes = [] ) : boolean Create Table
drop_column ( string $table, string $column_name ) : boolean Column Drop
drop_database ( string $db_name ) : boolean Drop database
drop_table ( string $table_name, boolean $if_exists = FALSE ) : boolean Drop Table
modify_column ( string $table, string $field ) : boolean Column Modify
rename_table ( string $table_name, string $new_table_name ) : boolean Rename Table

보호된 메소드들

메소드 설명
_alter_table ( string $alter_type, string $table, mixed $field ) : string | string[] ALTER TABLE
_attr_auto_increment ( &$attributes, &$field ) : void Field attribute AUTO_INCREMENT
_attr_default ( &$attributes, &$field ) : void Field attribute DEFAULT
_attr_type ( &$attributes ) : void Field attribute TYPE
_attr_unique ( &$attributes, &$field ) : void Field attribute UNIQUE
_attr_unsigned ( &$attributes, &$field ) : void Field attribute UNSIGNED
_create_table ( string $table, boolean $if_not_exists, array $attributes ) : mixed Create Table
_create_table_attr ( array $attributes ) : string CREATE TABLE attributes
_drop_table ( string $table, boolean $if_exists ) : string Drop Table
_process_column ( array $field ) : string Process column
_process_fields ( boolean $create_table = FALSE ) : array Process fields
_process_indexes ( string $table ) : string Process indexes
_process_primary_keys ( string $table ) : string Process primary keys
_reset ( ) : void Reset

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( &$db ) : void
리턴 void

_alter_table() 보호된 메소드

ALTER TABLE
protected _alter_table ( string $alter_type, string $table, mixed $field ) : string | string[]
$alter_type string ALTER type
$table string Table name
$field mixed Column definition
리턴 string | string[]

_attr_auto_increment() 보호된 메소드

Field attribute AUTO_INCREMENT
protected _attr_auto_increment ( &$attributes, &$field ) : void
리턴 void

_attr_default() 보호된 메소드

Field attribute DEFAULT
protected _attr_default ( &$attributes, &$field ) : void
리턴 void

_attr_type() 보호된 메소드

Performs a data type mapping between different databases.
protected _attr_type ( &$attributes ) : void
리턴 void

_attr_unique() 보호된 메소드

Field attribute UNIQUE
protected _attr_unique ( &$attributes, &$field ) : void
리턴 void

_attr_unsigned() 보호된 메소드

Depending on the _unsigned property value: - TRUE will always set $field['unsigned'] to 'UNSIGNED' - FALSE will always set $field['unsigned'] to '' - array(TYPE) will set $field['unsigned'] to 'UNSIGNED', if $attributes['TYPE'] is found in the array - array(TYPE => UTYPE) will change $field['type'], from TYPE to UTYPE in case of a match
protected _attr_unsigned ( &$attributes, &$field ) : void
리턴 void

_create_table() 보호된 메소드

Create Table
protected _create_table ( string $table, boolean $if_not_exists, array $attributes ) : mixed
$table string Table name
$if_not_exists boolean Whether to add 'IF NOT EXISTS' condition
$attributes array Associative array of table attributes
리턴 mixed

_create_table_attr() 보호된 메소드

CREATE TABLE attributes
protected _create_table_attr ( array $attributes ) : string
$attributes array Associative array of table attributes
리턴 string

_drop_table() 보호된 메소드

Generates a platform-specific DROP TABLE string
protected _drop_table ( string $table, boolean $if_exists ) : string
$table string Table name
$if_exists boolean Whether to add an IF EXISTS condition
리턴 string

_process_column() 보호된 메소드

Process column
protected _process_column ( array $field ) : string
$field array
리턴 string

_process_fields() 보호된 메소드

Process fields
protected _process_fields ( boolean $create_table = FALSE ) : array
$create_table boolean
리턴 array

_process_indexes() 보호된 메소드

Process indexes
protected _process_indexes ( string $table ) : string
$table string
리턴 string

_process_primary_keys() 보호된 메소드

Process primary keys
protected _process_primary_keys ( string $table ) : string
$table string Table name
리턴 string

_reset() 보호된 메소드

Resets table creation vars
protected _reset ( ) : void
리턴 void

add_column() 공개 메소드

Column Add
public add_column ( string $table, array $field, string $_after = NULL ) : boolean
$table string Table name
$field array Column definition
$_after string Column for AFTER clause (deprecated)
리턴 boolean

add_field() 공개 메소드

Add Field
public add_field ( array $field ) : CI_DB_forge
$field array
리턴 CI_DB_forge

add_key() 공개 메소드

Add Key
public add_key ( string $key, boolean $primary = FALSE ) : CI_DB_forge
$key string
$primary boolean
리턴 CI_DB_forge

create_database() 공개 메소드

Create database
public create_database ( string $db_name ) : boolean
$db_name string
리턴 boolean

create_table() 공개 메소드

Create Table
public create_table ( string $table, boolean $if_not_exists = FALSE, array $attributes = [] ) : boolean
$table string Table name
$if_not_exists boolean Whether to add IF NOT EXISTS condition
$attributes array Associative array of table attributes
리턴 boolean

drop_column() 공개 메소드

Column Drop
public drop_column ( string $table, string $column_name ) : boolean
$table string Table name
$column_name string Column name
리턴 boolean

drop_database() 공개 메소드

Drop database
public drop_database ( string $db_name ) : boolean
$db_name string
리턴 boolean

drop_table() 공개 메소드

Drop Table
public drop_table ( string $table_name, boolean $if_exists = FALSE ) : boolean
$table_name string Table name
$if_exists boolean Whether to add an IF EXISTS condition
리턴 boolean

modify_column() 공개 메소드

Column Modify
public modify_column ( string $table, string $field ) : boolean
$table string Table name
$field string Column definition
리턴 boolean

rename_table() 공개 메소드

Rename Table
public rename_table ( string $table_name, string $new_table_name ) : boolean
$table_name string Old table name
$new_table_name string New table name
리턴 boolean

프로퍼티 상세

$_create_database 보호되어 있는 프로퍼티

CREATE DATABASE statement
protected string $_create_database
리턴 string

$_create_table 보호되어 있는 프로퍼티

CREATE TABLE statement
protected string $_create_table
리턴 string

$_create_table_if 보호되어 있는 프로퍼티

CREATE TABLE IF statement
protected string $_create_table_if
리턴 string

$_create_table_keys 보호되어 있는 프로퍼티

Whether table keys are created from within the CREATE TABLE statement.
protected bool $_create_table_keys
리턴 boolean

$_default 보호되어 있는 프로퍼티

DEFAULT value representation in CREATE/ALTER TABLE statements
protected string $_default
리턴 string

$_drop_database 보호되어 있는 프로퍼티

DROP DATABASE statement
protected string $_drop_database
리턴 string

$_drop_table_if 보호되어 있는 프로퍼티

DROP TABLE IF EXISTS statement
protected string $_drop_table_if
리턴 string

$_null 보호되어 있는 프로퍼티

NULL value representation in CREATE/ALTER TABLE statements
protected string $_null
리턴 string

$_rename_table 보호되어 있는 프로퍼티

RENAME TABLE statement
protected string $_rename_table
리턴 string

$_unsigned 보호되어 있는 프로퍼티

UNSIGNED support
protected bool|array $_unsigned
리턴 boolean | array

$db 보호되어 있는 프로퍼티

Database object
protected object $db
리턴 object

$db_char_set 공개적으로 프로퍼티

Database character set
public string $db_char_set
리턴 string

$fields 공개적으로 프로퍼티

Fields data
public array $fields
리턴 array

$keys 공개적으로 프로퍼티

Keys data
public array $keys
리턴 array

$primary_keys 공개적으로 프로퍼티

Primary Keys data
public array $primary_keys
리턴 array