<?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\ValidTrait;
use App\Entity\Traits\PublishedAtTrait;
/**
*
* @ORM\Entity(repositoryClass="App\Repository\AnnouncementRepository")
*
* @author wendell.zheng <wxzheng@ustc.edu.cn>
*/
class Announcement
{
use IdTrait, NameTrait, ContentTrait, PublishedAtTrait, TimestampableEntity, ValidTrait;
const NAME = '公告';
/**
*
* @ORM\OneToMany(targetEntity="AnnouncementAttachment", mappedBy="announcement")
*/
protected $attachments;
public function __construct()
{
$this->publishedAt = new \DateTime();
$this->attachments = new ArrayCollection();
}
/**
*
* @return Collection|AnnouncementAttachment[]
*/
public function getAttachments(): Collection
{
return $this->attachments;
}
}