<?php
|
declare(strict_types=1);
|
|
namespace App\Entity;
|
|
use App\Repository\OustedBorrowHistoryRepository;
|
use Doctrine\ORM\Mapping as ORM;
|
|
#[ORM\Entity(repositoryClass: OustedBorrowHistoryRepository::class)]
|
#[ORM\UniqueConstraint(name: 'ousted_borrow_history_book_at', columns: ['book_id', 'at'])]
|
class OustedBorrowHistory extends AbstractBorrowHistory {
|
#[ORM\ManyToOne(targetEntity: OustedBook::class, inversedBy: 'borrowHistory')]
|
#[ORM\JoinColumn(nullable: false)]
|
private OustedBook $book;
|
|
public function __construct(OustedBook $book, string $who, \DateTimeImmutable $at, \DateTimeImmutable $till) {
|
parent::__construct($who, $at, $till);
|
$this->book = $book;
|
}
|
|
public function getBook(): OustedBook {
|
return $this->book;
|
}
|
}
|