You are here

public function MenuLinkContentVisibilityChecker::isVisible in Custom Menu Links Visibility 8

File

src/MenuLinkContentVisibilityChecker.php, line 48

Class

MenuLinkContentVisibilityChecker

Namespace

Drupal\menu_link_content_visibility

Code

public function isVisible() {
  if ($visibility = unserialize($this->menu_link_content
    ->get('visibility')->value)) {
    foreach ($visibility as $condition_id => $condition_configuration) {
      if (!$this
        ->evaluateCondition($condition_id, $condition_configuration)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}