<?php namespace App\Entity; use App\Repository\PointTransactionImportHistoryRepository; use App\Traits\DateTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=PointTransactionImportHistoryRepository::class) */ class PointTransactionImportHistory { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $fileName; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ private $admin; /** * @ORM\Column(type="string", length=255) */ private $type; /** * @ORM\OneToMany(targetEntity=PointTransaction::class, mappedBy="importHistory") */ private $pointTransactions; public function __construct() { $this->pointTransactions = new ArrayCollection(); } use DateTrait; public function getId(): int { return $this->id; } public function getFileName(): ?string { return $this->fileName; } public function setFileName( ?string $fileName ): self { $this->fileName = $fileName; return $this; } public function getAdmin(): User { return $this->admin; } public function setAdmin( User $admin ): self { $this->admin = $admin; return $this; } public function getType(): ?string { return $this->type; } public function setType( string $type ): self { $this->type = $type; return $this; } /** * @return Collection|PointTransaction[] */ public function getPointTransactions(): Collection { return $this->pointTransactions; } public function addPointTransaction( PointTransaction $pointTransaction ): self { if ( !$this->pointTransactions->contains( $pointTransaction ) ) { $this->pointTransactions[] = $pointTransaction; $pointTransaction->setImportHistory( $this ); } return $this; } public function removePointTransaction( PointTransaction $pointTransaction ): self { if ( $this->pointTransactions->removeElement( $pointTransaction ) ) { // set the owning side to null (unless already changed) if ( $pointTransaction->getImportHistory() === $this ) { $pointTransaction->setImportHistory( NULL ); } } return $this; } }