Example #1
0
 /**
  * @param mixed $di - Device Identifier component
  *
  * @return bool
  */
 public static function validate($di)
 {
     $di = self::unDecorate($di);
     $validUdiLength = [8, 12, 13, 14];
     $length = strlen($di);
     if (!in_array($length, $validUdiLength)) {
         return false;
     }
     return parent::check($di, $length);
 }
Example #2
0
 /**
  * @param mixed $dun14
  *
  * @deprecated in favor of Gtin14
  *
  * @return bool
  */
 public static function validate($dun14)
 {
     return parent::check($dun14, 14);
 }