<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use App\Repository\SanctionRepository;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity(repositoryClass=SanctionRepository::class)
 */
class Sanction extends Document
{
    /**
     * @ORM\Column(type="text")
     * @Gedmo\Versioned
     */
    private $content;

    /**
     * @ORM\ManyToOne(targetEntity=User::class, inversedBy="sanctions")
     * @ORM\JoinColumn(nullable=false)
     */
    private $user;

    public function __construct(User $user)
    {
        parent::__construct($user);
        $this->setNeedGroupAdministration(true);
    }

    public function getContent(): ?string
    {
        return $this->content;
    }

    public function setContent(string $content): self
    {
        $this->content = $content;

        return $this;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): self
    {
        $this->user = $user;

        return $this;
    }
}
