Skip to content
Snippets Groups Projects
Commit 838d7e70 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1911814 by damiankloip: Add a setStatus() method for configuration entities.

parent 4bbff164
No related branches found
No related tags found
No related merge requests found
......@@ -99,15 +99,21 @@ public function set($property_name, $value, $langcode = NULL) {
* Implements \Drupal\Core\Config\Entity\ConfigEntityInterface::enable().
*/
public function enable() {
$this->status = TRUE;
return $this;
return $this->setStatus(TRUE);
}
/**
* Implements \Drupal\Core\Config\Entity\ConfigEntityInterface::disable().
*/
public function disable() {
$this->status = FALSE;
return $this->setStatus(FALSE);
}
/**
* Implements \Drupal\Core\Config\Entity\ConfigEntityInterface::setStatus().
*/
public function setStatus(bool $status) {
$this->status = $status;
return $this;
}
......
......@@ -48,6 +48,17 @@ public function enable();
*/
public function disable();
/**
* Sets the status of the configuration entity.
*
* @param bool $status
* The status of the configuration entity.
*
* @return \Drupal\Core\Config\Entity\ConfigEntityInterface
* The class instance that this method is called on.
*/
public function setStatus(bool $status);
/**
* Returns whether the configuration entity is enabled.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment