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. public function getBase() {
  77. $nameList = explode('/', $this->getName());
  78. return $nameList[0];
  79. }
  80. public function getQuote() {
  81. $nameList = explode('/', $this->getName());
  82. return $nameList[1];
  83. }
  84. /**
  85. * @return mixed
  86. */
  87. public function getPip() {
  88. return $this->pip;
  89. }
  90. /**
  91. * @param mixed $pip
  92. */
  93. public function setPip($pip): void {
  94. $this->pip = $pip;
  95. }
  96. public function getTrendVolatile(): ?string
  97. {
  98. return $this->trendVolatile;
  99. }
  100. public function setTrendVolatile(?string $trendVolatile): self
  101. {
  102. $this->trendVolatile = $trendVolatile;
  103. return $this;
  104. }
  105. public function getTrendUp(): ?string
  106. {
  107. return $this->trendUp;
  108. }
  109. public function setTrendUp(?string $trendUp): self
  110. {
  111. $this->trendUp = $trendUp;
  112. return $this;
  113. }
  114. public function getTrendDown(): ?string
  115. {
  116. return $this->trendDown;
  117. }
  118. public function setTrendDown(?string $trendDown): self
  119. {
  120. $this->trendDown = $trendDown;
  121. return $this;
  122. }
  123. /**
  124. * @return mixed
  125. */
  126. public function getPpp() {
  127. return $this->ppp;
  128. }
  129. /**
  130. * @param mixed $ppp
  131. */
  132. public function setPpp($ppp): void {
  133. $this->ppp = $ppp;
  134. }
  135. /**
  136. * @return mixed
  137. */
  138. public function getVolatility() {
  139. return $this->volatility;
  140. }
  141. /**
  142. * @param mixed $volatility
  143. */
  144. public function setVolatility($volatility): void {
  145. $this->volatility = $volatility;
  146. }
  147. }