BarcodeLayout.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\Pickup\Pdf;
  6. /**
  7. * Temando Pickup Pdf Barcode Layout
  8. *
  9. * Data container for barcode size and position.
  10. *
  11. * @package Temando\Shipping\Model
  12. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  13. * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  14. * @link https://www.temando.com/
  15. */
  16. class BarcodeLayout
  17. {
  18. /**
  19. * @var int
  20. */
  21. private $offsetTop;
  22. /**
  23. * @var int
  24. */
  25. private $offsetLeft;
  26. /**
  27. * @var float
  28. */
  29. private $moduleSize;
  30. /**
  31. * BarcodeLayout constructor.
  32. * @param int $offsetTop
  33. * @param int $offsetLeft
  34. * @param float $moduleSize
  35. */
  36. public function __construct(int $offsetTop = 46, int $offsetLeft = 285, float $moduleSize = 0.75)
  37. {
  38. $this->offsetTop = $offsetTop;
  39. $this->offsetLeft = $offsetLeft;
  40. $this->moduleSize = $moduleSize;
  41. }
  42. /**
  43. * Obtain barcode's position from the top.
  44. *
  45. * @return int
  46. */
  47. public function getOffsetTop(): int
  48. {
  49. return $this->offsetTop;
  50. }
  51. /**
  52. * Obtain barcode's position from the left.
  53. *
  54. * @return int
  55. */
  56. public function getOffsetLeft(): int
  57. {
  58. return $this->offsetLeft;
  59. }
  60. /**
  61. * Obtain barcode's sizing factor.
  62. *
  63. * @return float
  64. */
  65. public function getModuleSize(): float
  66. {
  67. return $this->moduleSize;
  68. }
  69. }