src/Entity/Transaction.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Generic\User;
  4. use App\Repository\TransactionRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  8. #[ORM\Entity(repositoryClassTransactionRepository::class)]
  9. class Transaction extends BaseEntity
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\Column(type'guid'uniquetrue)]
  13.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  14.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  15.     private ?string $id null;
  16.     #[ORM\ManyToOne(inversedBy'transactions')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?User $owner null;
  19.     #[ORM\Column]
  20.     private ?int $type null;
  21.     #[ORM\Column]
  22.     private ?int $price null;
  23.     #[ORM\Column(typeTypes::TEXT)]
  24.     private ?string $description null;
  25.     #[ORM\Column]
  26.     private ?int $beforeWallet null;
  27.     #[ORM\Column]
  28.     private ?int $afterWallet null;
  29.     #[ORM\Column]
  30.     private ?bool $mabeByAdmin null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $bidFollowCode null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $serviceId null;
  35.     #[ORM\ManyToOne(inversedBy'madeTransactions')]
  36.     private ?User $author null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $increaseType null;
  39.     #[ORM\Column]
  40.     private ?bool $isProfit null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $serviceProtocol null;
  43.     public function getOwnerEmail()
  44.     {
  45.         return $this->getOwner()->getEmail();
  46.     }
  47.     public function __construct()
  48.     {
  49.         parent::__construct();
  50.         $this->setMabeByAdmin(0);
  51.         $this->setIsProfit(0);
  52.     }
  53.     public function setMabeByAdmin(bool $mabeByAdmin): self
  54.     {
  55.         $this->mabeByAdmin $mabeByAdmin;
  56.         return $this;
  57.     }
  58.     public function getId(): ?string
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getOwner(): ?User
  63.     {
  64.         return $this->owner;
  65.     }
  66.     public function setOwner(?User $owner): self
  67.     {
  68.         $this->owner $owner;
  69.         return $this;
  70.     }
  71.     public function getType(): ?int
  72.     {
  73.         return $this->type;
  74.     }
  75.     public function setType(int $type): self
  76.     {
  77.         $this->type $type;
  78.         return $this;
  79.     }
  80.     public function getPrice(): ?int
  81.     {
  82.         return $this->price;
  83.     }
  84.     public function setPrice(int $price): self
  85.     {
  86.         $this->price $price;
  87.         return $this;
  88.     }
  89.     public function getDescription(): ?string
  90.     {
  91.         return $this->description;
  92.     }
  93.     public function setDescription(string $description): self
  94.     {
  95.         $this->description $description;
  96.         return $this;
  97.     }
  98.     public function getBeforeWallet(): ?int
  99.     {
  100.         return $this->beforeWallet;
  101.     }
  102.     public function setBeforeWallet(int $beforeWallet): self
  103.     {
  104.         $this->beforeWallet $beforeWallet;
  105.         return $this;
  106.     }
  107.     public function getAfterWallet(): ?int
  108.     {
  109.         return $this->afterWallet;
  110.     }
  111.     public function setAfterWallet(int $afterWallet): self
  112.     {
  113.         $this->afterWallet $afterWallet;
  114.         return $this;
  115.     }
  116.     public function isMabeByAdmin(): ?bool
  117.     {
  118.         return $this->mabeByAdmin;
  119.     }
  120.     public function getBidFollowCode(): ?string
  121.     {
  122.         return $this->bidFollowCode;
  123.     }
  124.     public function setBidFollowCode(?string $bidFollowCode): self
  125.     {
  126.         $this->bidFollowCode $bidFollowCode;
  127.         return $this;
  128.     }
  129.     public function getServiceId(): ?string
  130.     {
  131.         return $this->serviceId;
  132.     }
  133.     public function setServiceId(?string $serviceId): self
  134.     {
  135.         $this->serviceId $serviceId;
  136.         return $this;
  137.     }
  138.     public function getAuthor(): ?User
  139.     {
  140.         return $this->author;
  141.     }
  142.     public function setAuthor(?User $author): self
  143.     {
  144.         $this->author $author;
  145.         return $this;
  146.     }
  147.     public function getIncreaseType(): ?string
  148.     {
  149.         return $this->increaseType;
  150.     }
  151.     public function setIncreaseType(?string $increaseType): self
  152.     {
  153.         $this->increaseType $increaseType;
  154.         return $this;
  155.     }
  156.     public function isIsProfit(): ?bool
  157.     {
  158.         return $this->isProfit;
  159.     }
  160.     public function setIsProfit(bool $isProfit): self
  161.     {
  162.         $this->isProfit $isProfit;
  163.         return $this;
  164.     }
  165.     public function getServiceProtocol(): ?string
  166.     {
  167.         return $this->serviceProtocol;
  168.     }
  169.     public function setServiceProtocol(?string $serviceProtocol): self
  170.     {
  171.         $this->serviceProtocol $serviceProtocol;
  172.         return $this;
  173.     }
  174. }