<?php
namespace Plugin\EventsManagerPlugin\Entity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use Eccube\Entity\AbstractEntity;
use Plugin\CourcesManagerPlugin\Entity\TjoCourse;
/**
* @ORM\Entity
* @ORM\Table(name="tjo_event")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
* @ORM\Entity(repositoryClass="Plugin\EventsManagerPlugin\Repository\TjoEventRepository")
*/
class TjoEvent extends AbstractEntity
{
/**
* @var Collection
* @ORM\OneToMany(targetEntity="Plugin\EventsManagerPlugin\Entity\TjoSchedule", mappedBy="Event", cascade={"persist", "remove"}, orphanRemoval=true)
*/
private $Schedules;
public function __construct(){
$this->Schedules = new ArrayCollection();
}
/**
* Get Schedules
* @var Collection
*/
public function getSchedules(): Collection{
return $this->Schedules->matching(
Criteria::create()
->orderBy(['day' => Criteria::ASC, 'id' => Criteria::ASC])
);
return $this->Schedules;
}
/**
* Add Schedules
* @param TjoSchedule $Schedules
* @return self
*/
public function addSchedule(TjoSchedule $Schedule): self{
if (!$this->Schedules->contains($Schedule)) {
$this->Schedules[] = $Schedule;
$Schedule->setTjoCourse($this);
}
return $this;
}
/**
* Remove Schedules
* @param TjoSchedule $Schedules
* @return self
*/
public function removeSchedule(TjoSchedule $Schedule): self{
if ($this->Schedules->contains($Schedule)) {
$this->Schedules->removeElement($Schedule);
if ($Schedule->getTjoCourse() === $this) {
$Schedule->setTjoCourse(null);
}
}
return $this;
}
// ID
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
* @ORM\Column(name="recept_no", type="string", length=255)
* 受付番号
*/
private $recept_no;
/**
* @var string
* @ORM\Column(name="name", type="string", length=255)
* イベント名
*/
private $name;
/**
* @var string
* @ORM\Column(name="sub_title", type="string", length=255,nullable=true)
* サブタイトル
*/
private $sub_title;
/**
* @var \DateTime
* @ORM\Column(name="day_start", type="datetimetz",nullable=true)
* イベント開始日
*/
private $day_start;
/**
* @var \DateTime
* @ORM\Column(name="day_end", type="datetimetz",nullable=true)
* イベント終了日
*/
private $day_end;
/**
* @var \DateTime
* @ORM\Column(name="day_agreement", type="datetimetz",nullable=true)
* 承認日
*/
private $day_agreement;
/**
* @var \DateTime
* @ORM\Column(name="day_payment", type="datetimetz",nullable=true)
* 入金日
*/
private $day_payment;
/**
* @var string
* @ORM\Column(name="url1", type="string", length=255,nullable=true)
* イベント名
*/
private $url1;
/**
* @var string
* @ORM\Column(name="url2", type="string", length=255,nullable=true)
* イベント名
*/
private $url2;
/**
* @var string
* @ORM\Column(name="image",type="string",length="255",nullable="true"))
* 前半画像
*/
private $image;
/**
* @ORM\ManyToOne(targetEntity="Plugin\CourcesManagerPlugin\Entity\TjoCourse")
* @ORM\JoinColumn(name="tjo_course_id", referencedColumnName="id")
* コース
*/
private $Course;
/** @return int|null */
public function getId() : int|null {return $this->id;}
/** @return string|null */
public function getReceptNo() : ?string {return $this->recept_no;}
/**
* @param string $recept_no
* @return $this;
*/
public function setReceptNo($recept_no) : self {
$this->recept_no = $recept_no;
return $this;
}
/** @return string */
public function getName() : string {return $this->name;}
/**
* @param string $name
* @return $this;
*/
public function setName($name) : self {
$this->name = $name;
return $this;
}
/** @return string|null */
public function getSubTitle() : ?string {return $this->sub_title;}
/**
* @param string $sub_title
* @return $this;
*/
public function setSubTitle($sub_title) : self {
$this->sub_title = $sub_title;
return $this;
}
/** @return DateTime|null */
public function getDayStart() : DateTime|null {return $this->day_start;}
/**
* @param string $day_start
* @return $this;
*/
public function setDayStart($day_start) : self {
$this->day_start = $day_start;
return $this;
}
/** @return DateTime|null */
public function getDayEnd() : DateTime|null {return $this->day_end;}
/**
* @param string $day_end
* @return $this;
*/
public function setDayEnd($day_end) : self {
$this->day_end = $day_end;
return $this;
}
/** @return DateTime|null */
public function getDayAgreement() : DateTime|null {return $this->day_agreement;}
/**
* @param string $day_agreement
* @return $this;
*/
public function setDayAgreement($day_agreement) : self {
$this->day_agreement = $day_agreement;
return $this;
}
/** @return DateTime|null */
public function getDayPayment() : DateTime|null {return $this->day_payment;}
/**
* @param string $day_payment
* @return $this;
*/
public function setDayPayment($day_payment) : self {
$this->day_payment = $day_payment;
return $this;
}
/** @return string */
public function getUrl1() : ?string {return $this->url1;}
/**
* @param string $url1
* @return $this;
*/
public function setUrl1($url1) : self {
$this->url1 = $url1;
return $this;
}
/** @return string */
public function getUrl2() : ?string {return $this->url2;}
/**
* @param string $url2
* @return $this;
*/
public function setUrl2($url2) : self {
$this->url2 = $url2;
return $this;
}
/** @return string|null */
public function getImage() : string|null {return $this->image;}
/**
* @param string $image
* @return $this;
*/
public function setImage($image) : self {
$this->image = $image;
return $this;
}
/**
* Get Course
* @return TjoCourse|null
*/
public function getCourse(): ?TjoCourse{return $this->Course;}
/**
* Set Course
* @param TjoCourse $Course
* @return self
*/
public function setCourse(?TjoCourse $Course): self{
$this->Course = $Course;
return $this;
}
}