PHP Class Webiny\Component\Entity\Attribute\DynamicAttribute

Inheritance: extends AbstractAttribute
Show file Open project: Webiny/Framework

Protected Properties

Property Type Description
$callable
$defaultParams
$storeToDb
$storedValue

Public Methods

Method Description
__construct ( string $name = null, AbstractEntity $parent = null, callable $callable = null )
getDbValue ( )
getValue ( array $params = [], boolean $processCallbacks = true ) Get attribute value
setCallable ( $callable ) Set dynamic attribute function
setStoreToDb ( )
setValue ( null $value = null, boolean $fromDb = false ) Set attribute value
toArray ( $fields = [], $params = [] )

Protected Methods

Method Description
validate ( &$value ) Perform validation against given value

Method Details

__construct() public method

public __construct ( string $name = null, AbstractEntity $parent = null, callable $callable = null )
$name string
$parent Webiny\Component\Entity\AbstractEntity
$callable callable

getDbValue() public method

public getDbValue ( )

getValue() public method

Get attribute value
public getValue ( array $params = [], boolean $processCallbacks = true )
$params array
$processCallbacks boolean Process `onGet` callbacks

setCallable() public method

Set dynamic attribute function
public setCallable ( $callable )
$callable

setStoreToDb() public method

public setStoreToDb ( )

setValue() public method

Set attribute value
public setValue ( null $value = null, boolean $fromDb = false )
$value null
$fromDb boolean

toArray() public method

public toArray ( $fields = [], $params = [] )

validate() protected method

Perform validation against given value
protected validate ( &$value )
$value

Property Details

$callable protected property

protected $callable

$defaultParams protected property

protected $defaultParams

$storeToDb protected property

protected $storeToDb

$storedValue protected property

protected $storedValue