trait EntityNeedsSaveTrait in Entity Reference Revisions 8
Trait for EntityNeedsSaveInterface.
Hierarchy
- trait \Drupal\entity_reference_revisions\EntityNeedsSaveTrait
1 file declares its use of EntityNeedsSaveTrait
- EntityTestCompositeRelationship.php in tests/
modules/ entity_composite_relationship_test/ src/ Entity/ EntityTestCompositeRelationship.php
File
- src/
EntityNeedsSaveTrait.php, line 9
Namespace
Drupal\entity_reference_revisionsView source
trait EntityNeedsSaveTrait {
/**
* Whether the entity needs to be saved or not.
*
* @var bool
*/
protected $needsSave = FALSE;
/**
* {@inheritdoc}
*/
public function needsSave() {
return $this->needsSave;
}
/**
* {@inheritdoc}
*/
public function setNeedsSave($needs_save) {
$this->needsSave = $needs_save;
}
/**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
$this
->setNeedsSave(FALSE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityNeedsSaveTrait:: |
protected | property | Whether the entity needs to be saved or not. | |
EntityNeedsSaveTrait:: |
public | function | ||
EntityNeedsSaveTrait:: |
public | function | ||
EntityNeedsSaveTrait:: |
public | function |