class ColumnEntity extends Entity

ColumnEntity

  • FieldType 에서 table 스키마 를 정의 하기위해 사용
  • AbstractFieldType class 의 columns 멤버 변수의 항목들을 ColumnEntity class 로 구성

Properties

protected array $original The entity attribute's original state. from Entity
protected array $hidden The attributes that should be hidden for arrays. from Entity
protected array $fillable The attributes that are mass assignable. from Entity
protected array $guarded The attributes that aren't mass assignable. from Entity
bool $exists Indicates if the entity exists. from Entity
protected $default

Methods

__construct(string $name, string $dataType)

Constructor

$this
syncOriginal()

Sync the original attributes with the current.

from Entity
array
getOriginal(string|null $key = null, mixed $default = null)

Get the entity's original attribute values.

from Entity
$this
fill(array $attributes)

Fill the model with an array of attributes.

from Entity
bool
isFillable(string $key)

Determine if the given attribute may be mass assigned.

from Entity
bool
isGuarded(string $key)

Determine if the given key is guarded.

from Entity
array
getDirty()

Get the attributes that have been changed since last sync.

from Entity
array
toArray()

Convert the entity instance to an array.

from Entity
$this
setParams(array $params)

set params

$this
setUnsigned()

set unsigned attribute to true

$this
setNullAble()

set null able attribute to true

$this
setDefault(string $default)

set default attribute

$this
setDescription(string $description)

set description attribute

void
add(Blueprint $table, string $prefix = '')

parameter $table 에 설정에 맞는 adding column 구문을 수행한다.

void
drop(Blueprint $table, string $prefix = '')

컬럼 제거

Details

at line 52
__construct(string $name, string $dataType)

Constructor

Parameters

string $name table's column name
string $dataType ColumnDataType class's member attribute

in Entity at line 84
$this syncOriginal()

Sync the original attributes with the current.

Return Value

$this

in Entity at line 98
array getOriginal(string|null $key = null, mixed $default = null)

Get the entity's original attribute values.

Parameters

string|null $key key name
mixed $default default value when not exists

Return Value

array

in Entity at line 109
$this fill(array $attributes)

Fill the model with an array of attributes.

Parameters

array $attributes attributes

Return Value

$this

in Entity at line 126
bool isFillable(string $key)

Determine if the given attribute may be mass assigned.

Parameters

string $key key name

Return Value

bool

in Entity at line 145
bool isGuarded(string $key)

Determine if the given key is guarded.

Parameters

string $key key name

Return Value

bool

in Entity at line 155
array getDirty()

Get the attributes that have been changed since last sync.

Return Value

array

in Entity at line 165
array toArray()

Convert the entity instance to an array.

Return Value

array

at line 64
$this setParams(array $params)

set params

Parameters

array $params param's value

Return Value

$this

at line 76
$this setUnsigned()

set unsigned attribute to true

Return Value

$this

at line 88
$this setNullAble()

set null able attribute to true

Return Value

$this

at line 101
$this setDefault(string $default)

set default attribute

Parameters

string $default table's default value

Return Value

$this

at line 114
$this setDescription(string $description)

set description attribute

Parameters

string $description description

Return Value

$this

at line 128
void add(Blueprint $table, string $prefix = '')

parameter $table 에 설정에 맞는 adding column 구문을 수행한다.

Parameters

Blueprint $table schema builder
string $prefix column 이름 앞에 붙일 문자열

Return Value

void

at line 160
void drop(Blueprint $table, string $prefix = '')

컬럼 제거

Parameters

Blueprint $table schema builder
string $prefix column 이름 앞에 붙일 문자열

Return Value

void