You are here

public function Multigraph::removeSensor in Monitoring 8

Excludes a sensor that has previously been included.

Parameters

string $name: Machine name of included sensor.

Overrides MultigraphInterface::removeSensor

File

modules/multigraph/src/Entity/Multigraph.php, line 161
Contains \Drupal\monitoring_multigraph\Entity\Multigraph.

Class

Multigraph
Represents an aggregation of related sensors, called a multigraph.

Namespace

Drupal\monitoring_multigraph\Entity

Code

public function removeSensor($name) {
  unset($this->sensors[$name]);
  foreach ($this->sensorEntities as $key => $entity) {
    if ($entity
      ->id() == $name) {
      unset($this->sensorEntities[$key]);
      break;
    }
  }
}