src/Entity/UserBusinessResult.php line 17

Open in your IDE?
  1. <?php
  2.     
  3.     namespace App\Entity;
  4.     
  5.     use App\Repository\UserBusinessResultRepository;
  6.     use App\Traits\DateTrait;
  7.     use Doctrine\ORM\Mapping as ORM;
  8.     use JMS\Serializer\Annotation as Serializer;
  9.     use JMS\Serializer\Annotation\Expose;
  10.     
  11.     /**
  12.      * @ORM\Entity(repositoryClass=UserBusinessResultRepository::class)
  13.      * @ORM\HasLifecycleCallbacks()
  14.      *
  15.      * @Serializer\ExclusionPolicy("ALL")
  16.      */
  17.     class UserBusinessResult
  18.     {
  19.         use DateTrait;
  20.         
  21.         /**
  22.          * @ORM\Id
  23.          * @ORM\GeneratedValue
  24.          * @ORM\Column(type="integer")
  25.          *
  26.          * @Expose
  27.          * @Serializer\Groups({
  28.          *     "user_bussiness_result:id"
  29.          * })
  30.          */
  31.         private ?int $id NULL;
  32.         
  33.         /**
  34.          * @ORM\Column(type="integer")
  35.          *
  36.          * @Expose
  37.          * @Serializer\Groups({
  38.          *     "user_bussiness_result",
  39.          *     "user_bussiness_result:sale",
  40.          *     "userBusinessResult:sale",
  41.          *     "export_user_datatable"
  42.          * })
  43.          */
  44.         private ?int $sale NULL;
  45.         
  46.         /**
  47.          * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userBusinessResults" , fetch="EAGER")
  48.          * @ORM\JoinColumn(nullable=true)
  49.          *
  50.          * @Expose
  51.          * @Serializer\Groups({
  52.          *     "user_bussiness_result",
  53.          *     "user_bussiness_result:user"
  54.          *     })
  55.          */
  56.         private ?User $user;
  57.         
  58.         /**
  59.          * @ORM\Column(type="string", length=64, nullable=true)
  60.          *
  61.          * @Expose
  62.          * @Serializer\Groups({
  63.          *     "user_bussiness_result",
  64.          *     "user_bussiness_result:rrdi_code"
  65.          * })
  66.          */
  67.         private ?string $rrdiCode NULL;
  68.         
  69.         /**
  70.          * @ORM\Column(type="string", length=64, nullable=true)
  71.          *
  72.          * @Expose
  73.          * @Serializer\Groups({
  74.          *     "user_bussiness_result",
  75.          *     "user_bussiness_result:seller_code"
  76.          * })
  77.          */
  78.         private ?string $sellerCode NULL;
  79.         
  80.         /**
  81.          * @ORM\Column(type="integer", nullable=true)
  82.          *
  83.          * @Expose
  84.          * @Serializer\Groups({"user_bussiness_result"})
  85.          */
  86.         private ?int $highlight NULL;
  87.         
  88.         /**
  89.          * @ORM\OneToOne(targetEntity=PointTransaction::class, mappedBy="businessResult", cascade={"persist", "remove"})
  90.          */
  91.         private ?PointTransaction $pointTransaction;
  92.         
  93.         
  94.         public function getId(): ?int
  95.         {
  96.             return $this->id;
  97.         }
  98.         
  99.         
  100.         public function getSale(): ?int
  101.         {
  102.             return $this->sale;
  103.         }
  104.         
  105.         
  106.         public function setSaleint $sale ): self
  107.         {
  108.             $this->sale $sale;
  109.             
  110.             return $this;
  111.         }
  112.         
  113.         
  114.         public function getRrdiCode(): ?string
  115.         {
  116.             return $this->rrdiCode;
  117.         }
  118.         
  119.         
  120.         public function setRrdiCode( ?string $rrdiCode ): self
  121.         {
  122.             $this->rrdiCode $rrdiCode;
  123.             
  124.             return $this;
  125.         }
  126.         
  127.         
  128.         public function getSellerCode(): ?string
  129.         {
  130.             return $this->sellerCode;
  131.         }
  132.         
  133.         
  134.         public function setSellerCode( ?string $sellerCode ): self
  135.         {
  136.             $this->sellerCode $sellerCode;
  137.             
  138.             return $this;
  139.         }
  140.         
  141.         
  142.         public function getHighlight(): ?int
  143.         {
  144.             return $this->highlight;
  145.         }
  146.         
  147.         
  148.         public function setHighlight( ?int $highlight ): self
  149.         {
  150.             $this->highlight $highlight;
  151.             
  152.             return $this;
  153.         }
  154.         
  155.         
  156.         public function getUser(): ?User
  157.         {
  158.             return $this->user;
  159.         }
  160.         
  161.         
  162.         public function setUser( ?User $user ): self
  163.         {
  164.             $this->user $user;
  165.             
  166.             return $this;
  167.         }
  168.         
  169.         
  170.         public function getPointTransaction(): ?PointTransaction
  171.         {
  172.             return $this->pointTransaction;
  173.         }
  174.         
  175.         
  176.         public function setPointTransaction( ?PointTransaction $pointTransaction ): self
  177.         {
  178.             // unset the owning side of the relation if necessary
  179.             if ( $pointTransaction === NULL && $this->pointTransaction !== NULL ) {
  180.                 $this->pointTransaction->setBusinessResultNULL );
  181.             }
  182.             
  183.             // set the owning side of the relation if necessary
  184.             if ( $pointTransaction !== NULL && $pointTransaction->getBusinessResult() !== $this ) {
  185.                 $pointTransaction->setBusinessResult$this );
  186.             }
  187.             
  188.             $this->pointTransaction $pointTransaction;
  189.             
  190.             return $this;
  191.         }
  192.     }