You are here

public function ExcludeNodeTitleManager::removeNodeFromList in Exclude Node Title 8

Removes node exclude list.

Parameters

mixed $param: Can be a node object or integer value (nid).

Overrides ExcludeNodeTitleManagerInterface::removeNodeFromList

File

src/ExcludeNodeTitleManager.php, line 299

Class

ExcludeNodeTitleManager
Service class for Exclude Node Title module settings management.

Namespace

Drupal\exclude_node_title

Code

public function removeNodeFromList($param) {
  if ($param instanceof NodeInterface) {
    $param = $param
      ->id();
  }
  if (!is_numeric($param)) {
    return FALSE;
  }
  $exclude_list = $this
    ->getExcludedNodes();
  if (($key = array_search($param, $exclude_list)) !== FALSE) {
    unset($exclude_list[$key]);
    $this->settingsConfig
      ->set('nid_list', $exclude_list)
      ->save();
  }
  return $this;
}