<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use App\Entity\Traits\IdTrait;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\ContentTrait;
use App\Entity\Traits\PublishedAtTrait;
use App\Entity\Traits\BatchMethodTrait;
/**
*
* @ORM\Entity(repositoryClass="App\Repository\NoticeRepository")
*
* @author wendell.zheng <wxzheng@ustc.edu.cn>
*/
class Notice
{
use IdTrait, NameTrait, ContentTrait, PublishedAtTrait, TimestampableEntity, BatchMethodTrait;
const NAME = '通知';
/**
*
* @ORM\ManyToOne(targetEntity="Batch", inversedBy="notices")
*/
protected $batch;
/**
*
* @ORM\OneToMany(targetEntity="NoticeAttachment", mappedBy="notice")
*/
protected $attachments;
public function __construct()
{
$this->publishedAt = new \DateTime();
$this->attachments = new ArrayCollection();
}
/**
*
* @return Collection|NoticeAttachment[]
*/
public function getAttachments(): Collection
{
return $this->attachments;
}
}