setCheck example

protected $_characters = '0123456789';

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
protected $_checksum = '_gtin';

    /** * Overrides parent checkLength * * @param string $value Value * @return boolean */
    public function checkLength($value)
    {
        if (strlen($value) != 8) {
            $this->setCheck(false);
        } else {
            $this->setCheck(true);
        }

        return parent::checkLength($value);
    }
}
protected $_characters = '0123456789';

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
protected $_checksum = '_code25';

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
protected $_checksum = '_code25';

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
protected $_characters = 128;

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}


    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }

    /** * Validates the checksum (Modulo CK) * * @param string $value The barcode to validate * @return boolean */
    protected function _code93($value)
    {
        $checksum = substr($value, -2, 2);
        


    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }

    /** * Validates the checksum (Modulo 43) * * @param string $value The barcode to validate * @return boolean */
    protected function _code39($value)
    {
        $checksum = substr($value, -1, 1);
        
protected $_checksum = '_gtin';

    /** * Overrides parent checkLength * * @param string $value Value * @return boolean */
    public function checkLength($value)
    {
        if (strlen($value) == 7) {
            $this->setCheck(false);
        } else {
            $this->setCheck(true);
        }

        return parent::checkLength($value);
    }
}
protected $_characters = 128;

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
return $this->getAdapter()->getCheck();
    }

    /** * Sets the checksum option * * @param boolean $checksum * @return Zend_Validate_Barcode */
    public function setChecksum($checksum)
    {
        $this->getAdapter()->setCheck($checksum);
        return $this;
    }

    /** * Defined by Zend_Validate_Interface * * Returns true if and only if $value contains a valid barcode * * @param string $value * @return boolean */
    
protected $_characters = '0123456789';

    /** * Constructor * * Sets check flag to false. * * @return void */
    public function __construct()
    {
        $this->setCheck(false);
    }
}
Home | Imprint | This part of the site doesn't use cookies.