<?php
namespace App\Entity;
use App\Repository\ArtistsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\HttpFoundation\File\File;
/**
* @ORM\Entity(repositoryClass=ArtistsRepository::class)
*/
class artists
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
public $id;
/**
* @ORM\Column(type="text", length=100)
* @ORM\OneToMany(targetEntity="battlepool", mappedBy="artist")
*/
public $artist;
/**
* @ORM\Column(type="text", length=250)
*/
public $streamlink;
/**
* @ORM\Column(type="datetime")
*/
protected $registration_date;
/**
* @ORM\Column(type="text", length=100)
*/
private $email;
/**
* @ORM\Column(type="text", length=60)
*/
private $ip;
/**
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
public $blocked;
/**
* @ORM\Column(type="integer")
*/
public $allow_battle_invites;
/**
* @ORM\Column(type="integer")
*/
public $judge;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\File(mimeTypes={ "image/png", "image/jpeg" })
*/
public $image;
public function getId(): ?int
{
return $this->id;
}
public function getArtist(): ?string
{
return $this->artist;
}
public function setArtist(string $artist): self
{
$this->artist = $artist;
return $this;
}
public function getRegistration_date(): ?\DateTimeInterface
{
return $this->registration_date;
}
public function setRegistration_date(\DateTimeInterface $registration_date): self
{
$this->registration_date = $registration_date;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getIp(): ?string
{
return $this->ip;
}
public function setIp(string $ip): self
{
$this->ip = $ip;
return $this;
}
public function getBlocked(): ?int
{
return $this->blocked;
}
public function setBlocked(int $blocked): self
{
$this->blocked = $blocked;
return $this;
}
public function getAllowBattleInvites(): ?int
{
return $this->allow_battle_invites;
}
public function setAllowBattleInvites(int $allow_battle_invites): self
{
$this->allow_battle_invites = $allow_battle_invites;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function __construct()
{
$this->registration_date = new \DateTime();
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$this->ip = $ip;
$this->blocked = 0;
$this->judge = 0;
$this->allow_battle_invites = 0;
}
public function getStreamlink(): ?string
{
return $this->streamlink;
}
public function setStreamlink(string $streamlink): self
{
$this->streamlink = $streamlink;
return $this;
}
public function getRegistrationDate(): ?\DateTimeInterface
{
return $this->registration_date;
}
public function setRegistrationDate(\DateTimeInterface $registration_date): self
{
$this->registration_date = $registration_date;
return $this;
}
public function getJudge(): ?int
{
return $this->judge;
}
public function setJudge(int $judge): self
{
$this->judge = $judge;
return $this;
}
}