<?php
namespace App\Entity;
use App\Repository\SpeakerCharityRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SpeakerCharityRepository::class)
*/
class SpeakerCharity
{
const TYPE_FIX = 0;
const TYPE_PERCENT = 1;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Charity::class)
* @ORM\JoinColumn(nullable=false)
*/
private $charity;
/**
* @ORM\ManyToOne(targetEntity=Speaker::class, inversedBy="charities")
* @ORM\JoinColumn(nullable=false)
*/
private $speaker;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $amount = 0;
/**
* @ORM\Column(type="integer")
*/
private $type = self::TYPE_FIX;
public function getId(): ?int
{
return $this->id;
}
public function getCharity(): ?Charity
{
return $this->charity;
}
public function setCharity(?Charity $charity): self
{
$this->charity = $charity;
return $this;
}
public function getSpeaker(): ?Speaker
{
return $this->speaker;
}
public function setSpeaker(?Speaker $speaker): self
{
$this->speaker = $speaker;
return $this;
}
public function getAmount(): ?int
{
return $this->amount;
}
public function setAmount(?int $amount): self
{
$this->amount = $amount;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(?int $type): self
{
$this->type = (is_null($type)) ? self::TYPE_FIX : $type;
return $this;
}
}