Exemplo n.º 1
0
 /**
  * Constructor
  * @param array|\Zend\Config\Config $options
  * @return void
  */
 public function __construct($options = null)
 {
     $this->_getDefaultOptions();
     if (Barcode\Barcode::getBarcodeFont() !== null) {
         $this->_font = Barcode\Barcode::getBarcodeFont();
     }
     if ($options instanceof Config\Config) {
         $options = $options->toArray();
     }
     if (is_array($options)) {
         $this->setOptions($options);
     }
     /** @todo check if conversion is correct */
     // $this->_type = strtolower(substr(get_class($this), strlen($this->_barcodeNamespace) + 1));
     $this->_type = substr(strrchr(get_class($this), '\\'), 1);
     if ($this->_mandatoryChecksum) {
         $this->_withChecksum = true;
         $this->_withChecksumInText = true;
     }
 }
Exemplo n.º 2
0
 /**
  * Constructor
  * @param array|\Zend\Config\Config $options
  * @return void
  */
 public function __construct($options = null)
 {
     $this->_getDefaultOptions();
     $this->_font = Barcode\Barcode::getBarcodeFont();
     if ($options instanceof Config) {
         $options = $options->toArray();
     }
     if (is_array($options)) {
         $this->setOptions($options);
     }
     $this->_type = strtolower(substr(get_class($this), strlen($this->_barcodeNamespace) + 1));
     if ($this->_mandatoryChecksum) {
         $this->_withChecksum = true;
         $this->_withChecksumInText = true;
     }
 }
Exemplo n.º 3
0
 /**
  * Constructor
  * @param array|Traversable $options
  * @return void
  */
 public function __construct($options = null)
 {
     $this->getDefaultOptions();
     $this->font = Barcode\Barcode::getBarcodeFont();
     if ($options instanceof Traversable) {
         $options = ArrayUtils::iteratorToArray($options);
     }
     if (is_array($options)) {
         $this->setOptions($options);
     }
     $this->type = strtolower(substr(get_called_class(), strlen($this->barcodeNamespace) + 1));
     if ($this->mandatoryChecksum) {
         $this->withChecksum = true;
         $this->withChecksumInText = true;
     }
 }