You are here

public static function OfficialFacebookPixelUtils::isPositiveInteger in Official Facebook Pixel 8

Same name and namespace in other branches
  1. 7 src/OfficialFacebookPixelUtils.php \Drupal\official_facebook_pixel\OfficialFacebookPixelUtils::isPositiveInteger()

Returns true if id is a positive non-zero integer

@access public

Parameters

string $pixel_id:

Return value

bool

1 call to OfficialFacebookPixelUtils::isPositiveInteger()
official_facebook_pixel_page_attachments in ./official_facebook_pixel.module
Implements hook_page_attachments().

File

src/OfficialFacebookPixelUtils.php, line 36
Contains \Drupal\official_facebook_pixel \OfficialFacebookPixelUtils.

Class

OfficialFacebookPixelUtils
Class OfficialFacebookPixelUtils.

Namespace

Drupal\official_facebook_pixel

Code

public static function isPositiveInteger($pixel_id) {
  return isset($pixel_id) && ctype_digit($pixel_id) && $pixel_id !== '0';
}