You are here

function wf_crm_is_positive in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/utils.inc \wf_crm_is_positive()

Check if value is a positive integer

Parameters

mixed $val:

Return value

bool

6 calls to wf_crm_is_positive()
wf_crm_webform_base::findContact in includes/wf_crm_webform_base.inc
Find an existing contact based on matching criteria Used to populate a webform existing contact field
wf_crm_webform_postprocess::verifyExistingContact in includes/wf_crm_webform_postprocess.inc
Ensure we have a valid contact id in a contact ref field
wf_crm_webform_preprocess::findCaseClientForDefaultContact in includes/wf_crm_webform_preprocess.inc
Function to load default contact (cid1) if default loading is set to case_roles
wf_crm_webform_preprocess::findExistingActivities in includes/wf_crm_webform_preprocess.inc
Find activity ids based on url input or "existing activity" settings
wf_crm_webform_preprocess::findExistingCases in includes/wf_crm_webform_preprocess.inc
Find case ids based on url input or "existing case" settings

... See full list

File

includes/utils.inc, line 1730
Webform CiviCRM module's common utility functions.

Code

function wf_crm_is_positive($val) {
  return is_numeric($val) && $val > 0 && round($val) == $val;
}