You are here

protected function SortBaseForm::sortIdExists in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_server/src/Form/SortBaseForm.php \Drupal\entity_share_server\Form\SortBaseForm::sortIdExists()
  2. 8 modules/entity_share_server/src/Form/SortBaseForm.php \Drupal\entity_share_server\Form\SortBaseForm::sortIdExists()

Check if the sort exists.

Return value

bool True if the sort exists. FALSE otherwise.

4 calls to SortBaseForm::sortIdExists()
SortDeleteForm::actions in modules/entity_share_server/src/Form/SortDeleteForm.php
Returns an array of supported actions for the current entity form.
SortDeleteForm::form in modules/entity_share_server/src/Form/SortDeleteForm.php
Gets the actual form array to be built.
SortEditForm::actions in modules/entity_share_server/src/Form/SortEditForm.php
Returns an array of supported actions for the current entity form.
SortEditForm::form in modules/entity_share_server/src/Form/SortEditForm.php
Gets the actual form array to be built.

File

modules/entity_share_server/src/Form/SortBaseForm.php, line 85

Class

SortBaseForm
Class SortBaseForm.

Namespace

Drupal\entity_share_server\Form

Code

protected function sortIdExists() {

  /** @var \Drupal\entity_share_server\Entity\ChannelInterface $channel */
  $channel = $this->entity;
  $channel_sorts = $channel
    ->get('channel_sorts');
  $sort_id = $this
    ->getsortId();
  $sort_exists = FALSE;
  if (isset($channel_sorts[$sort_id])) {
    $sort_exists = TRUE;
  }
  return $sort_exists;
}