src/Entity/UserMemeCoinTransactionEntity.php line 17

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\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\UserMemeCoinTransactionRepository")
  10.  * @ORM\Table(name="user_meme_coin_transaction")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  */
  13. class UserMemeCoinTransactionEntity
  14. {
  15.     /**
  16.      * @ORM\Column(type="bigint")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected $id;
  21.     /**
  22.      * @ORM\Column(name="amount",type="decimal", precision=18, scale=8)
  23.      */
  24.     protected $amount;
  25.    /**
  26.      * @ORM\Column(name="base_price",type="decimal", precision=18, scale=8, nullable=true)
  27.      */
  28.     protected $basePrice;
  29.    /**
  30.      * @ORM\Column(name="system_fee",type="decimal", precision=18, scale=8, nullable=true)
  31.      */
  32.     protected $systemFee;
  33.     /**
  34.      * @ORM\Column(name="created_by", type="string", length=50)
  35.      */
  36.     protected $createdBy;
  37.     /**
  38.      * @ORM\Column(name="created_at", type="datetime")
  39.      */
  40.     protected $createdAt;
  41.     /**
  42.      * @ORM\Column(name="updated_by", type="string", length=50)
  43.      */
  44.     protected $updatedBy;
  45.     /**
  46.      * @ORM\Column(name="updated_at", type="datetime")
  47.      */
  48.     protected $updatedAt;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="UserEntity", inversedBy="userMemeCoinTransactionBuyers")
  51.      * @ORM\JoinColumn(name="buyer_id", referencedColumnName="id")
  52.      */
  53.     protected $buyer;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity="UserEntity", inversedBy="userMemeCoinTransactionSellers")
  56.      * @ORM\JoinColumn(name="seller_id", referencedColumnName="id")
  57.      */
  58.     protected $seller;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity="UserMemeCoinEntity", inversedBy="userMemeCoinTransactions")
  61.      * @ORM\JoinColumn(name="user_memecoin_id", referencedColumnName="id")
  62.      */
  63.     protected $userMemeCoin;
  64.     /**
  65.      * Set createdAt
  66.      *
  67.      * @ORM\PrePersist
  68.      */
  69.     public function setCreatedAtValue()
  70.     {
  71.         $this->createdBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  72.         $this->createdAt = new \DateTime();
  73.         $this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  74.         $this->updatedAt = new \DateTime();
  75.  
  76.     }
  77.     /**
  78.      * Set updatedAt
  79.      *
  80.      * @ORM\PreUpdate
  81.      */
  82.     public function setUpdatedAtValue()
  83.     {
  84.         $this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  85.         $this->updatedAt = new \DateTime();
  86.     }
  87.     public function __construct($data=null)
  88.     {
  89.         if(!is_null($data)) {
  90.         }
  91.   
  92.     }
  93.     /*--------------------------------------------------------------------------------------------------------*/
  94.     /*                    User Defined Setters and Getters                                                      */
  95.     /*--------------------------------------------------------------------------------------------------------*/
  96.     public function getId(): ?string
  97.     {
  98.         return $this->id;
  99.     }
  100.     public function getAmount(): ?string
  101.     {
  102.         return $this->amount;
  103.     }
  104.     public function setAmount(string $amount): static
  105.     {
  106.         $this->amount $amount;
  107.         return $this;
  108.     }
  109.     public function getBasePrice(): ?string
  110.     {
  111.         return $this->basePrice;
  112.     }
  113.     public function setBasePrice(?string $basePrice): static
  114.     {
  115.         $this->basePrice $basePrice;
  116.         return $this;
  117.     }
  118.     public function getSystemFee(): ?string
  119.     {
  120.         return $this->systemFee;
  121.     }
  122.     public function setSystemFee(?string $systemFee): static
  123.     {
  124.         $this->systemFee $systemFee;
  125.         return $this;
  126.     }
  127.     public function getCreatedBy(): ?string
  128.     {
  129.         return $this->createdBy;
  130.     }
  131.     public function setCreatedBy(string $createdBy): static
  132.     {
  133.         $this->createdBy $createdBy;
  134.         return $this;
  135.     }
  136.     public function getCreatedAt(): ?\DateTimeInterface
  137.     {
  138.         return $this->createdAt;
  139.     }
  140.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  141.     {
  142.         $this->createdAt $createdAt;
  143.         return $this;
  144.     }
  145.     public function getUpdatedBy(): ?string
  146.     {
  147.         return $this->updatedBy;
  148.     }
  149.     public function setUpdatedBy(string $updatedBy): static
  150.     {
  151.         $this->updatedBy $updatedBy;
  152.         return $this;
  153.     }
  154.     public function getUpdatedAt(): ?\DateTimeInterface
  155.     {
  156.         return $this->updatedAt;
  157.     }
  158.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  159.     {
  160.         $this->updatedAt $updatedAt;
  161.         return $this;
  162.     }
  163.     public function getBuyer(): ?UserEntity
  164.     {
  165.         return $this->buyer;
  166.     }
  167.     public function setBuyer(?UserEntity $buyer): static
  168.     {
  169.         $this->buyer $buyer;
  170.         return $this;
  171.     }
  172.     public function getSeller(): ?UserEntity
  173.     {
  174.         return $this->seller;
  175.     }
  176.     public function setSeller(?UserEntity $seller): static
  177.     {
  178.         $this->seller $seller;
  179.         return $this;
  180.     }
  181.     public function getUserMemeCoin(): ?UserMemeCoinEntity
  182.     {
  183.         return $this->userMemeCoin;
  184.     }
  185.     public function setUserMemeCoin(?UserMemeCoinEntity $userMemeCoin): static
  186.     {
  187.         $this->userMemeCoin $userMemeCoin;
  188.         return $this;
  189.     }
  190.   
  191. }