PHP Class Webiny\Component\Entity\Attribute\Many2ManyAttribute

Inheritance: extends AbstractCollectionAttribute, use trait Webiny\Component\Mongo\MongoTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Protected Properties

Свойство Type Description
$addedItems
$intermediateCollection

Méthodes publiques

Méthode Description
__construct ( $attribute = null, AbstractEntity $entity = null, $collectionName )
getValue ( array $params = [], boolean $processCallbacks = true ) : null | EntityCollection Get attribute value
hasValue ( )
save ( ) Insert links into DB
setValue ( null $value = null, boolean $fromDb = false ) Set or get attribute value
unlink ( string | AbstractEntity $item ) : boolean Remove item from many2many collection (removes the link between entities)
unlinkAll ( ) : boolean Remove all items from man2many collection (removes the links between entities)

Méthodes protégées

Méthode Description
extractClassName ( $class ) : string Extract short class name from class namespace
load ( ) : EntityCollection Load many2many attribute value (prepares MongoCursor, lazy loads data)
unlinkItem ( string | AbstractEntity $item ) : boolean Unlink given item (only removes the aggregation record)

Method Details

__construct() public méthode

public __construct ( $attribute = null, AbstractEntity $entity = null, $collectionName )
$entity Webiny\Component\Entity\AbstractEntity

extractClassName() protected méthode

Extract short class name from class namespace
protected extractClassName ( $class ) : string
$class
Résultat string

getValue() public méthode

Get attribute value
public getValue ( array $params = [], boolean $processCallbacks = true ) : null | EntityCollection
$params array
$processCallbacks boolean
Résultat null | Webiny\Component\Entity\EntityCollection

hasValue() public méthode

public hasValue ( )

load() protected méthode

Load many2many attribute value (prepares MongoCursor, lazy loads data)
protected load ( ) : EntityCollection
Résultat Webiny\Component\Entity\EntityCollection

save() public méthode

Insert links into DB
public save ( )

setValue() public méthode

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

unlinkAll() public méthode

Remove all items from man2many collection (removes the links between entities)
public unlinkAll ( ) : boolean
Résultat boolean

unlinkItem() protected méthode

Unlink given item (only removes the aggregation record)
protected unlinkItem ( string | AbstractEntity $item ) : boolean
$item string | Webiny\Component\Entity\AbstractEntity
Résultat boolean

Property Details

$addedItems protected_oe property

protected $addedItems

$intermediateCollection protected_oe property

protected $intermediateCollection