public function ProfileType::preSave in Profile 8
Acts on an entity before the presave hook is invoked.
Used before the entity is saved and before invoking the presave hook.
Ensure that config entities which are bundles of other entities cannot have their ID changed.
Parameters
\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.
Throws
\Drupal\Core\Config\ConfigNameException Thrown when attempting to rename a bundle entity.
Overrides ConfigEntityBundleBase::preSave
File
- src/
Entity/ ProfileType.php, line 206
Class
- ProfileType
- Defines the profile type entity class.
Namespace
Drupal\profile\EntityCode
public function preSave(EntityStorageInterface $storage) {
if ($this
->shouldCreateNewRevision() && !$this
->allowsRevisions()) {
$this
->set('new_revision', FALSE);
}
}