You are here

public function CustomContextualLink::clearOptions in Custom Contextual Links 8.2

Ensures that only options according to the link type are set.

Overrides CustomContextualLinkInterface::clearOptions

File

src/Entity/CustomContextualLink.php, line 127

Class

CustomContextualLink
Defines the Custom Contextual Link entity.

Namespace

Drupal\ccl\Entity

Code

public function clearOptions() {
  foreach ($this->options as $key => $option) {
    if (strpos($key, $this->type) !== 0) {
      unset($this->options[$key]);
    }
  }
}