private function VotingApiReactionForm::checkStatus in Voting API Reaction 8
Check if current form should be visible, closed or opened.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
Return value
mixed Null if form should be hidden. Boolean if form is disabled or enabled.
1 call to VotingApiReactionForm::checkStatus()
- VotingApiReactionForm::buildForm in src/
Form/ VotingApiReactionForm.php - Form constructor.
File
- src/
Form/ VotingApiReactionForm.php, line 283
Class
- VotingApiReactionForm
- Form implementation of the reaction form used in field formatter.
Namespace
Drupal\votingapi_reaction\FormCode
private function checkStatus(FormStateInterface $form_state) {
$items = $form_state
->get('field_items');
if ($items->status == VotingApiReactionItemInterface::HIDDEN) {
return NULL;
}
return $items->status == VotingApiReactionItemInterface::OPEN;
}