You are here

public function SearchBaseForm::searchExists in Entity Share 8.3

Same name and namespace in other branches
  1. 8.2 modules/entity_share_server/src/Form/SearchBaseForm.php \Drupal\entity_share_server\Form\SearchBaseForm::searchExists()

Check to see if a search already exists with the specified name.

Parameters

string $name: The machine name to check for.

Return value

bool True if it already exists.

File

modules/entity_share_server/src/Form/SearchBaseForm.php, line 35

Class

SearchBaseForm
Base class for search form.

Namespace

Drupal\entity_share_server\Form

Code

public function searchExists($name) {

  /** @var \Drupal\entity_share_server\Entity\ChannelInterface $channel */
  $channel = $this->entity;
  $channel_searches = $channel
    ->get('channel_searches');
  if (is_null($channel_searches)) {
    return FALSE;
  }
  if (isset($channel_searches[$name])) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}