public function SortBaseForm::sortExists in Entity Share 8
Same name and namespace in other branches
- 8.3 modules/entity_share_server/src/Form/SortBaseForm.php \Drupal\entity_share_server\Form\SortBaseForm::sortExists()
- 8.2 modules/entity_share_server/src/Form/SortBaseForm.php \Drupal\entity_share_server\Form\SortBaseForm::sortExists()
Check to see if a sort 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/ SortBaseForm.php, line 46
Class
- SortBaseForm
- Class SortBaseForm.
Namespace
Drupal\entity_share_server\FormCode
public function sortExists($name) {
/** @var \Drupal\entity_share_server\Entity\ChannelInterface $channel */
$channel = $this->entity;
$channel_sorts = $channel
->get('channel_sorts');
if (is_null($channel_sorts)) {
return FALSE;
}
if (isset($channel_sorts[$name])) {
return TRUE;
}
else {
return FALSE;
}
}