src/Entity/ObjectCustomer.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ObjectCustomerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ObjectCustomerRepository::class)
  9.  * @ORM\Table(name="object_customer",
  10.  *    uniqueConstraints={
  11.  *        @ORM\UniqueConstraint(name="object_customer_unique",
  12.  *            columns={"customer_id", "object_id", "auction_id"})
  13.  *    }
  14.  * )
  15.  */
  16. class ObjectCustomer
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="Customer")
  26.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
  27.      */
  28.     private $customer;
  29.     /**
  30.      * @ORM\Column(type="integer")
  31.      */
  32.     private $object_id;
  33.     /**
  34.      * @ORM\Column(type="string")
  35.      */
  36.     private $auction_id;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="AuctionBid", mappedBy="object_customer")
  39.      */
  40.     private $bids;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity=AuctionAutoBid::class, mappedBy="object_customer")
  43.      */
  44.     private $auctionAutoBids;
  45.     /**
  46.      * @ORM\Column(type="boolean")
  47.      */
  48.     private $winning false;
  49.     /**
  50.      * @ORM\Column(type="integer")
  51.      */
  52.     private $number;
  53.     public function __construct()
  54.     {
  55.         $this->bids = new ArrayCollection();
  56.         $this->auctionAutoBids = new ArrayCollection();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getCustomer(): Customer
  63.     {
  64.         return $this->customer;
  65.     }
  66.     public function setCustomer(Customer $customer): self
  67.     {
  68.         $this->customer $customer;
  69.         return $this;
  70.     }
  71.     public function getObjectId(): ?int
  72.     {
  73.         return $this->object_id;
  74.     }
  75.     public function setObjectId(int $object_id): self
  76.     {
  77.         $this->object_id $object_id;
  78.         return $this;
  79.     }
  80.     public function getAuctionId(): ?string
  81.     {
  82.         return $this->auction_id;
  83.     }
  84.     public function setAuctionId(string $auction_id): self
  85.     {
  86.         $this->auction_id $auction_id;
  87.         return $this;
  88.     }
  89.     public function getBids(): ArrayCollection
  90.     {
  91.         return $this->bids;
  92.     }
  93.     /**
  94.      * @return Collection|AuctionAutoBid[]
  95.      */
  96.     public function getAuctionAutoBids(): Collection
  97.     {
  98.         return $this->auctionAutoBids;
  99.     }
  100.     public function addAuctionAutoBid(AuctionAutoBid $auctionAutoBid): self
  101.     {
  102.         if (!$this->auctionAutoBids->contains($auctionAutoBid)) {
  103.             $this->auctionAutoBids[] = $auctionAutoBid;
  104.             $auctionAutoBid->setObjectCustomer($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeAuctionAutoBid(AuctionAutoBid $auctionAutoBid): self
  109.     {
  110.         if ($this->auctionAutoBids->removeElement($auctionAutoBid)) {
  111.             if ($auctionAutoBid->getObjectCustomer() === $this) {
  112.                 $auctionAutoBid->setObjectCustomer(null);
  113.             }
  114.         }
  115.         return $this;
  116.     }
  117.     public function isWinning(): ?bool
  118.     {
  119.         return $this->winning;
  120.     }
  121.     public function setWinning(bool $winning): self
  122.     {
  123.         $this->winning $winning;
  124.         return $this;
  125.     }
  126.     public function getNumber(): ?int
  127.     {
  128.         return $this->number;
  129.     }
  130.     public function setNumber(int $number): self
  131.     {
  132.         $this->number $number;
  133.         return $this;
  134.     }
  135. }