PHP Class Webiny\Component\Entity\Attribute\One2ManyAttribute

Inheritance: extends Webiny\Component\Entity\Attribute\CollectionAttributeAbstract, use trait Webiny\Component\StdLib\StdLibTrait
Mostra file Open project: Webiny/Framework

Protected Properties

Property Type Description
$dataLoaded
$filter
$onDelete
$parent null | Webiny\Component\Entity\AbstractEntity
$relatedAttribute
$sorter

Public Methods

Method Description
__construct ( null | string $name = null, AbstractEntity $parent = null, string $relatedAttribute )
getOnDelete ( ) : string Get action to perform when parent entity is being deleted.
getRelatedAttribute ( ) Get attribute that defines a foreign key
getValue ( array $params = [], boolean $processCallbacks = true ) : boolean | null | AbstractEntity Set or get attribute value
hasValue ( )
isLoaded ( )
setFilter ( array | callable $filter ) Filter returned result set
setOnDelete ( string $action = 'cascade' ) Set action to perform when parent entity is being deleted.
setSorter ( array | string $sorter ) Sort returned result set
setValue ( $value = null, $fromDb = false )

Private Methods

Method Description
cleanUpRecords ( $newValues )
parseSorter ( $fields )

Method Details

__construct() public method

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

getOnDelete() public method

Get action to perform when parent entity is being deleted.
public getOnDelete ( ) : string
return string

getRelatedAttribute() public method

Get attribute that defines a foreign key
public getRelatedAttribute ( )

getValue() public method

Set or get attribute value
public getValue ( array $params = [], boolean $processCallbacks = true ) : boolean | null | AbstractEntity
$params array
$processCallbacks boolean
return boolean | null | Webiny\Component\Entity\AbstractEntity

hasValue() public method

public hasValue ( )

isLoaded() public method

public isLoaded ( )

setFilter() public method

Filter returned result set
public setFilter ( array | callable $filter )
$filter array | callable

setOnDelete() public method

Set action to perform when parent entity is being deleted.
public setOnDelete ( string $action = 'cascade' )
$action string cascade|restrict Default value is 'cascade'

setSorter() public method

Sort returned result set
public setSorter ( array | string $sorter )
$sorter array | string Ex: ['-order', '+createdOn'] or '-order,+createdOn'

setValue() public method

public setValue ( $value = null, $fromDb = false )

Property Details

$dataLoaded protected_oe property

protected $dataLoaded

$filter protected_oe property

protected $filter

$onDelete protected_oe property

protected $onDelete

$parent protected_oe property

protected null|AbstractEntity,Webiny\Component\Entity $parent
return null | Webiny\Component\Entity\AbstractEntity

$relatedAttribute protected_oe property

protected $relatedAttribute

$sorter protected_oe property

protected $sorter