SearchBaseForm.php in Entity Share 8.3
File
modules/entity_share_server/src/Form/SearchBaseForm.php
View source
<?php
declare (strict_types=1);
namespace Drupal\entity_share_server\Form;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Form\FormStateInterface;
class SearchBaseForm extends EntityForm {
protected function actions(array $form, FormStateInterface $form_state) {
$actions = parent::actions($form, $form_state);
unset($actions['delete']);
return $actions;
}
public function searchExists($name) {
$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;
}
}
protected function getsearchId() {
if (!isset($this->searchId)) {
$this->searchId = $this
->getRequest()->attributes
->get('search');
}
return $this->searchId;
}
protected function searchIdExists() {
$channel = $this->entity;
$channel_searches = $channel
->get('channel_searches');
$search_id = $this
->getsearchId();
$search_exists = FALSE;
if (isset($channel_searches[$search_id])) {
$search_exists = TRUE;
}
return $search_exists;
}
}