Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CookieLifetimeValidator.php
Go to the documentation of this file.
1 <?php
8 
9 class CookieLifetimeValidator extends \Magento\Framework\Validator\AbstractValidator
10 {
14  public function isValid($value)
15  {
16  $this->_clearMessages();
17  if (!is_numeric($value)) {
18  $this->_addMessages(['must be numeric']);
19  return false;
20  }
21  if ($value < 0) {
22  $this->_addMessages(['must be a positive integer or zero']);
23  return false;
24  }
25  return true;
26  }
27 }
$value
Definition: gender.phtml:16