PHP 트레잇 Mongolid\Model\Attributes

It is supposed to be used in model classes in general
파일 보기 프로젝트 열기: leroy-merlin-br/mongolid

공개 프로퍼티들

프로퍼티 타입 설명
$mutable boolean Check if model should mutate attributes checking the existence of a specific method on model class. Default is true.

보호된 프로퍼티들

프로퍼티 타입 설명
$attributes array The model's attributes.
$fillable array Once you put at least one string in this array, only the attributes specified here will be changed with the setAttributes method.
$guarded array The attributes that are not mass assignable. The opposite to the fillable array;.
$original array The model attribute's original state.

공개 메소드들

메소드 설명
__get ( mixed $key ) : mixed Dynamically retrieve attributes on the model.
__isset ( mixed $key ) : boolean Determine if an attribute exists on the model.
__set ( mixed $key, mixed $value ) : void Dynamically set attributes on the model.
__unset ( mixed $key ) : void Unset an attribute on the model.
cleanAttribute ( string $key ) : void Set a given attribute on the model.
fill ( array $input, boolean $force = false ) : void Set the model attributes using an array.
getAttribute ( string $key ) : mixed Get an attribute from the model.
getAttributes ( ) : mixed Get all attributes from the model.
setAttribute ( string $key, mixed $value ) : void Set a given attribute on the model.
syncOriginalAttributes ( ) : void Stores original attributes from actual data from attributes to be used in future comparisons about changes.
toArray ( ) : array Returns the model instance as an Array.

보호된 메소드들

메소드 설명
buildMutatorMethod ( mixed $key, mixed $prefix ) : string Create mutator method pattern.
hasMutatorMethod ( mixed $key, mixed $prefix ) : boolean Verify if model has a mutator method defined.

메소드 상세

__get() 공개 메소드

Dynamically retrieve attributes on the model.
public __get ( mixed $key ) : mixed
$key mixed Name of the attribute.
리턴 mixed

__isset() 공개 메소드

Determine if an attribute exists on the model.
public __isset ( mixed $key ) : boolean
$key mixed Attribute name.
리턴 boolean

__set() 공개 메소드

Dynamically set attributes on the model.
public __set ( mixed $key, mixed $value ) : void
$key mixed Attribute name.
$value mixed Value to be set.
리턴 void

__unset() 공개 메소드

Unset an attribute on the model.
public __unset ( mixed $key ) : void
$key mixed Attribute name.
리턴 void

buildMutatorMethod() 보호된 메소드

Create mutator method pattern.
protected buildMutatorMethod ( mixed $key, mixed $prefix ) : string
$key mixed Attribute name.
$prefix mixed Method prefix to be used.
리턴 string

cleanAttribute() 공개 메소드

Set a given attribute on the model.
public cleanAttribute ( string $key ) : void
$key string Name of the attribute to be unset.
리턴 void

fill() 공개 메소드

Set the model attributes using an array.
public fill ( array $input, boolean $force = false ) : void
$input array The data that will be used to fill the attributes.
$force boolean Force fill.
리턴 void

getAttribute() 공개 메소드

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string The attribute to be accessed.
리턴 mixed

getAttributes() 공개 메소드

Get all attributes from the model.
public getAttributes ( ) : mixed
리턴 mixed

hasMutatorMethod() 보호된 메소드

Verify if model has a mutator method defined.
protected hasMutatorMethod ( mixed $key, mixed $prefix ) : boolean
$key mixed Attribute name.
$prefix mixed Method prefix to be used.
리턴 boolean

setAttribute() 공개 메소드

Set a given attribute on the model.
public setAttribute ( string $key, mixed $value ) : void
$key string Name of the attribute to be set.
$value mixed Value to be set.
리턴 void

syncOriginalAttributes() 공개 메소드

Ideally should be called once right after retrieving data from the database.
public syncOriginalAttributes ( ) : void
리턴 void

toArray() 공개 메소드

Returns the model instance as an Array.
public toArray ( ) : array
리턴 array

프로퍼티 상세

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

The model's attributes.
protected array $attributes
리턴 array

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

Once you put at least one string in this array, only the attributes specified here will be changed with the setAttributes method.
protected array $fillable
리턴 array

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

The attributes that are not mass assignable. The opposite to the fillable array;.
protected array $guarded
리턴 array

$mutable 공개적으로 프로퍼티

Check if model should mutate attributes checking the existence of a specific method on model class. Default is true.
public bool $mutable
리턴 boolean

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

The model attribute's original state.
protected array $original
리턴 array