public function Domain::disable in Domain Access 8
Disables the configuration entity.
Return value
$this
Overrides ConfigEntityBase::disable
File
- domain/
src/ Entity/ Domain.php, line 242
Class
- Domain
- Defines the domain entity.
Namespace
Drupal\domain\EntityCode
public function disable() {
if (!$this
->isDefault()) {
$this
->setStatus(FALSE);
$this
->setHostname($this
->getCanonical());
$this
->save();
}
else {
\Drupal::messenger()
->addMessage($this
->t('The default domain cannot be disabled.'), 'warning');
}
}