PHP Class Webiny\Component\Entity\Attribute\DynamicAttribute

Inheritance: extends AbstractAttribute
Exibir arquivo 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_oe property

protected $callable

$defaultParams protected_oe property

protected $defaultParams

$storeToDb protected_oe property

protected $storeToDb

$storedValue protected_oe property

protected $storedValue