Commit 838d7e70 authored by webchick's avatar webchick

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

parent 4bbff164
......@@ -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.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment