<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use App\Entity\Traits\IdTrait;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\BatchMethodTrait;
use App\Entity\Traits\OrderTrait;
/**
*
* @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
*/
class Category
{
use IdTrait, NameTrait, BatchMethodTrait, OrderTrait;
const NAME = '项目类型';
/**
*
* @ORM\ManyToOne(targetEntity="Batch")
*/
protected $batch;
/**
*
* @ORM\OneToMany(targetEntity="Level", mappedBy="category")
*/
protected $levels;
public function __construct()
{
$this->levels = new ArrayCollection();
}
/**
*
* @return Collection|Level[]
*/
public function getLevels(): Collection
{
return $this->levels;
}
}