src/Entity/Olympiad/Review.php line 19
<?php
namespace App\Entity\Olympiad;
use App\Entity\Common\File;
use App\Entity\Common\Owner;
use App\Entity\Geo\Region;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use App\Model\Common\HaveOwnerInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'olympiad_reviews')]
#[ORM\Entity(repositoryClass: 'App\Repository\Olympiad\ReviewRepository')]
#[ORM\HasLifecycleCallbacks]
class Review implements HaveOwnerInterface, UserCreatedInterface, UserUpdatedInterface
{
use TrackerFields;
/**
* @var
*/
#[ORM\Embedded(class: 'App\Entity\Common\Owner')]
private $owner;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean', name: 'is_published')]
private bool $published = false;
#[ORM\Column(type: 'string', nullable: true)]
private ?string $caption = null;
#[ORM\Column(type: 'string', nullable: true)]
private ?string $email = null;
#[ORM\Column(type: 'string', nullable: true)]
private ?string $eduOrg = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Geo\Region')]
private ?Region $region = null;
/**
* @var File|null
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Common\File', cascade: ['remove', 'persist'])]
private ?File $photo;
#[ORM\JoinTable(name: 'olympiad_review_file_relation')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Common\File', cascade: ['remove', 'persist'])]
private Collection $photos;
/**
* @var
*/
#[ORM\Column(type: 'text')]
private string $text;
public function __construct()
{
$this->owner = new Owner();
$this->photos = new ArrayCollection();
}
/**
* @return Owner
*/
public function getOwner(): Owner
{
return $this->owner;
}
/**
* @param Owner $owner
*/
public function setOwner(Owner $owner): void
{
$this->owner = $owner;
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}
/**
* @return bool
*/
public function isPublished(): bool
{
return $this->published;
}
/**
* @param bool $published
*/
public function setPublished(bool $published): void
{
$this->published = $published;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->caption;
}
/**
* @param string|null $caption
*/
public function setCaption(?string $caption): void
{
$this->caption = $caption;
}
/**
* @return string|null
*/
public function getEduOrg(): ?string
{
return $this->eduOrg;
}
/**
* @param string|null $eduOrg
*/
public function setEduOrg(?string $eduOrg): void
{
$this->eduOrg = $eduOrg;
}
/**
* @return Region|null
*/
public function getRegion(): ?Region
{
return $this->region;
}
/**
* @param Region|null $region
*/
public function setRegion(?Region $region): void
{
$this->region = $region;
}
/**
* @return mixed
*/
public function getText(): string
{
return $this->text;
}
/**
* @param mixed $text
*/
public function setText(string $text): void
{
$this->text = $text;
}
/**
* @return string|null
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @param string|null $email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
/**
* @return File|null
*/
public function getPhoto(): ?File
{
return $this->photo;
}
/**
* @param File|null $photo
*/
public function setPhoto(?File $photo): void
{
$this->photo = $photo;
}
/**
* @return ArrayCollection|Collection
*/
public function getPhotos()
{
return $this->photos;
}
/**
* @param ArrayCollection|Collection $photos
*/
public function setPhotos($photos): void
{
$this->photos = $photos;
}
public function addPhotoFile(File $file)
{
$this->photos->add($file);
}
}