<?php
namespace App\Entity;
use App\Repository\UserPointsHistoryRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=UserPointsHistoryRepository::class)
*/
class UserPointsHistory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Users::class, inversedBy="userPointsHistories")
* @ORM\JoinColumn(nullable=false)
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $user;
/**
* @ORM\Column(type="integer")
*/
private $points;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $deleted_at;
/**
* @ORM\ManyToOne(targetEntity=Rewards::class, inversedBy="userPointsHistories")
*/
private $reward;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?Users
{
return $this->user;
}
public function setUser(?Users $user): self
{
$this->user = $user;
return $this;
}
public function getPoints(): ?int
{
return $this->points;
}
public function setPoints(int $points): self
{
$this->points = $points;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getDeletedAt(): ?\DateTimeImmutable
{
return $this->deleted_at;
}
public function setDeletedAt(?\DateTimeImmutable $deleted_at): self
{
$this->deleted_at = $deleted_at;
return $this;
}
public function getReward(): ?Rewards
{
return $this->reward;
}
public function setReward(?Rewards $reward): self
{
$this->reward = $reward;
return $this;
}
}