function Block::setVisibilityConfig
Same name in other branches
- 9 core/modules/block/src/Entity/Block.php \Drupal\block\Entity\Block::setVisibilityConfig()
- 8.9.x core/modules/block/src/Entity/Block.php \Drupal\block\Entity\Block::setVisibilityConfig()
- 11.x core/modules/block/src/Entity/Block.php \Drupal\block\Entity\Block::setVisibilityConfig()
Overrides BlockInterface::setVisibilityConfig
File
-
core/
modules/ block/ src/ Entity/ Block.php, line 270
Class
- Block
- Defines a Block configuration entity class.
Namespace
Drupal\block\EntityCode
public function setVisibilityConfig($instance_id, array $configuration) {
$conditions = $this->getVisibilityConditions();
if (!$conditions->has($instance_id)) {
$configuration['id'] = $instance_id;
$conditions->addInstanceId($instance_id, $configuration);
}
else {
$conditions->setInstanceConfiguration($instance_id, $configuration);
}
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.