src/Entity/CurrencyPair.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\CurrencyHistory;
  7. /**
  8. * @ORM\Entity(repositoryClass="App\Repository\CurrencyPairRepository")
  9. */
  10. class CurrencyPair {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", unique=true, length=255)
  19. */
  20. private $name;
  21. /**
  22. * @ORM\Column(type="boolean")
  23. */
  24. private $status;
  25. /**
  26. * @ORM\Column(type="decimal", precision=8, scale=5)
  27. */
  28. private $pip;
  29. /**
  30. * @ORM\Column(type="string", length=10, nullable=true)
  31. */
  32. private $trendVolatile;
  33. /**
  34. * @ORM\Column(type="string", length=10, nullable=true)
  35. */
  36. private $trendUp;
  37. /**
  38. * @ORM\Column(type="string", length=10, nullable=true)
  39. */
  40. private $trendDown;
  41. /**
  42. * @ORM\Column(type="string", length=10, nullable=true)
  43. */
  44. private $ppp;
  45. /**
  46. * @ORM\Column(type="string", length=10, nullable=true)
  47. */
  48. private $volatility;
  49. public function __construct() {
  50. $this->forwards = new ArrayCollection();
  51. }
  52. public function getId(): ?int {
  53. return $this->id;
  54. }
  55. public function getName(): ?string {
  56. return $this->name;
  57. }
  58. public function setName(string $name): self {
  59. $this->name = $name;
  60. return $this;
  61. }
  62. public function getStatus(): ?bool {
  63. return $this->status;
  64. }
  65. public function setStatus(bool $status): self {
  66. $this->status = $status;
  67. return $this;
  68. }
  69. public function __toString() {
  70. return $this->getName();
  71. }
  72. public function getCurrencyNameByNumber($nr) {
  73. $nameList = explode('/', $this->getName());
  74. return $nameList[$nr - 1];
  75. }
  76. /**
  77. * @return mixed
  78. */
  79. public function getPip() {
  80. return $this->pip;
  81. }
  82. /**
  83. * @param mixed $pip
  84. */
  85. public function setPip($pip): void {
  86. $this->pip = $pip;
  87. }
  88. public function getTrendVolatile(): ?string
  89. {
  90. return $this->trendVolatile;
  91. }
  92. public function setTrendVolatile(?string $trendVolatile): self
  93. {
  94. $this->trendVolatile = $trendVolatile;
  95. return $this;
  96. }
  97. public function getTrendUp(): ?string
  98. {
  99. return $this->trendUp;
  100. }
  101. public function setTrendUp(?string $trendUp): self
  102. {
  103. $this->trendUp = $trendUp;
  104. return $this;
  105. }
  106. public function getTrendDown(): ?string
  107. {
  108. return $this->trendDown;
  109. }
  110. public function setTrendDown(?string $trendDown): self
  111. {
  112. $this->trendDown = $trendDown;
  113. return $this;
  114. }
  115. /**
  116. * @return mixed
  117. */
  118. public function getPpp() {
  119. return $this->ppp;
  120. }
  121. /**
  122. * @param mixed $ppp
  123. */
  124. public function setPpp($ppp): void {
  125. $this->ppp = $ppp;
  126. }
  127. /**
  128. * @return mixed
  129. */
  130. public function getVolatility() {
  131. return $this->volatility;
  132. }
  133. /**
  134. * @param mixed $volatility
  135. */
  136. public function setVolatility($volatility): void {
  137. $this->volatility = $volatility;
  138. }
  139. }