getChecksum example

$this->_error(self::INVALID_LENGTH);
            return false;
        }

        $result = $adapter->checkChars($value);
        if (!$result) {
            $this->_error(self::INVALID_CHARS);
            return false;
        }

        if ($this->getChecksum()) {
            $result = $adapter->checksum($value);
            if (!$result) {
                $this->_error(self::FAILED);
                return false;
            }
        }

        return true;
    }
}
return true;
    }

    /** * Validates the checksum * * @param string $value The barcode to check the checksum for * @return boolean */
    public function checksum($value)
    {
        $checksum = $this->getChecksum();
        if (!empty($checksum)) {
            if (method_exists($this$checksum)) {
                return call_user_func(array($this$checksum)$value);
            }
        }

        return false;
    }

    /** * Returns the allowed barcode length * * @return string */
Home | Imprint | This part of the site doesn't use cookies.