/** * @param Checkbox $checkbox * @return bool */ public static function validateCheckedCount(Checkbox $checkbox) { return $checkbox->getForm()->isSubmitted()->getParent()->lookupPath(NForm::class) !== 'actions-buttons' || in_array(TRUE, $checkbox->getParent()->getValues(TRUE), TRUE); }