<?php
namespace App\Entity;
use App\Repository\UserBusinessResultRepository;
use App\Traits\DateTrait;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use JMS\Serializer\Annotation\Expose;
/**
* @ORM\Entity(repositoryClass=UserBusinessResultRepository::class)
* @ORM\HasLifecycleCallbacks()
*
* @Serializer\ExclusionPolicy("ALL")
*/
class UserBusinessResult
{
use DateTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @Expose
* @Serializer\Groups({
* "user_bussiness_result:id"
* })
*/
private ?int $id = NULL;
/**
* @ORM\Column(type="integer")
*
* @Expose
* @Serializer\Groups({
* "user_bussiness_result",
* "user_bussiness_result:sale",
* "userBusinessResult:sale",
* "export_user_datatable"
* })
*/
private ?int $sale = NULL;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="userBusinessResults" , fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*
* @Expose
* @Serializer\Groups({
* "user_bussiness_result",
* "user_bussiness_result:user"
* })
*/
private ?User $user;
/**
* @ORM\Column(type="string", length=64, nullable=true)
*
* @Expose
* @Serializer\Groups({
* "user_bussiness_result",
* "user_bussiness_result:rrdi_code"
* })
*/
private ?string $rrdiCode = NULL;
/**
* @ORM\Column(type="string", length=64, nullable=true)
*
* @Expose
* @Serializer\Groups({
* "user_bussiness_result",
* "user_bussiness_result:seller_code"
* })
*/
private ?string $sellerCode = NULL;
/**
* @ORM\Column(type="integer", nullable=true)
*
* @Expose
* @Serializer\Groups({"user_bussiness_result"})
*/
private ?int $highlight = NULL;
/**
* @ORM\OneToOne(targetEntity=PointTransaction::class, mappedBy="businessResult", cascade={"persist", "remove"})
*/
private ?PointTransaction $pointTransaction;
public function getId(): ?int
{
return $this->id;
}
public function getSale(): ?int
{
return $this->sale;
}
public function setSale( int $sale ): self
{
$this->sale = $sale;
return $this;
}
public function getRrdiCode(): ?string
{
return $this->rrdiCode;
}
public function setRrdiCode( ?string $rrdiCode ): self
{
$this->rrdiCode = $rrdiCode;
return $this;
}
public function getSellerCode(): ?string
{
return $this->sellerCode;
}
public function setSellerCode( ?string $sellerCode ): self
{
$this->sellerCode = $sellerCode;
return $this;
}
public function getHighlight(): ?int
{
return $this->highlight;
}
public function setHighlight( ?int $highlight ): self
{
$this->highlight = $highlight;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser( ?User $user ): self
{
$this->user = $user;
return $this;
}
public function getPointTransaction(): ?PointTransaction
{
return $this->pointTransaction;
}
public function setPointTransaction( ?PointTransaction $pointTransaction ): self
{
// unset the owning side of the relation if necessary
if ( $pointTransaction === NULL && $this->pointTransaction !== NULL ) {
$this->pointTransaction->setBusinessResult( NULL );
}
// set the owning side of the relation if necessary
if ( $pointTransaction !== NULL && $pointTransaction->getBusinessResult() !== $this ) {
$pointTransaction->setBusinessResult( $this );
}
$this->pointTransaction = $pointTransaction;
return $this;
}
}