PHP Trait Kodeine\Metable\Metable

Show file Open project: kodeine/laravel-meta

Public Methods

Method Description
__get ( $attr )
__isset ( $key )
__set ( $key, $value )
__unset ( $key )
getAttribute ( string $key ) : mixed Get an attribute from the model.
getMeta ( $key = null, $raw = false ) Get Meta Data functions -------------------------
scopeMeta ( $query ) Meta scope for easier join -------------------------
setMeta ( $key, $value = null ) Set Meta Data functions -------------------------
toArray ( ) : array Convert the model instance to an array.
unsetMeta ( $key ) Unset Meta Data functions -------------------------
whereMeta ( $key, $value ) Query Meta Table functions -------------------------

Protected Methods

Method Description
getMetaArray ( $keys, $raw = false )
getMetaData ( )
getMetaKeyName ( ) : string Return the foreign key name for the meta table
getMetaNull ( )
getMetaString ( $key, $raw = false )
getMetaTable ( ) : null Return the table name
getModelKey ( ) : string Return the key for the model
getModelStub ( )
saveMeta ( )
setMetaArray ( )
setMetaString ( $key, $value )
setObserver ( ) Trait specific functions -------------------------
unsetMetaArray ( )
unsetMetaString ( $key )

Method Details

__get() public method

public __get ( $attr )

__isset() public method

public __isset ( $key )

__set() public method

public __set ( $key, $value )

__unset() public method

public __unset ( $key )

getAttribute() public method

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string
return mixed

getMeta() public method

Get Meta Data functions -------------------------
public getMeta ( $key = null, $raw = false )

getMetaArray() protected method

protected getMetaArray ( $keys, $raw = false )

getMetaData() protected method

protected getMetaData ( )

getMetaKeyName() protected method

Return the foreign key name for the meta table
protected getMetaKeyName ( ) : string
return string

getMetaNull() protected method

protected getMetaNull ( )

getMetaString() protected method

protected getMetaString ( $key, $raw = false )

getMetaTable() protected method

Return the table name
protected getMetaTable ( ) : null
return null

getModelKey() protected method

Return the key for the model
protected getModelKey ( ) : string
return string

getModelStub() protected method

protected getModelStub ( )

saveMeta() protected method

protected saveMeta ( )

scopeMeta() public method

Meta scope for easier join -------------------------
public scopeMeta ( $query )

setMeta() public method

Set Meta Data functions -------------------------
public setMeta ( $key, $value = null )

setMetaArray() protected method

protected setMetaArray ( )

setMetaString() protected method

protected setMetaString ( $key, $value )

setObserver() protected method

Trait specific functions -------------------------
protected setObserver ( )

toArray() public method

Convert the model instance to an array.
public toArray ( ) : array
return array

unsetMeta() public method

Unset Meta Data functions -------------------------
public unsetMeta ( $key )

unsetMetaArray() protected method

protected unsetMetaArray ( )

unsetMetaString() protected method

protected unsetMetaString ( $key )

whereMeta() public method

Query Meta Table functions -------------------------
public whereMeta ( $key, $value )