mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-28 01:30:11 -07:00
116 lines
1.8 KiB
PHP
116 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace AppBundle\Entity\LDraw;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* Category.
|
|
*
|
|
* @ORM\Table(name="ldraw_category")
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\CategoryRepository")
|
|
*/
|
|
class Category
|
|
{
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="name", type="string", length=255, unique=true)
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var Collection
|
|
*
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\LDraw\Part", mappedBy="category")
|
|
*/
|
|
private $parts;
|
|
|
|
/**
|
|
* BuildingKit constructor.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->parts = new ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set name.
|
|
*
|
|
* @param string $name
|
|
*
|
|
* @return Category
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get name.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* Get parts.
|
|
*
|
|
* @return ArrayCollection
|
|
*/
|
|
public function getParts()
|
|
{
|
|
return $this->parts;
|
|
}
|
|
|
|
/**
|
|
* @param Part $part
|
|
*
|
|
* @return Category
|
|
*/
|
|
public function addPart(Part $part)
|
|
{
|
|
$this->parts->add($part);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @param Part $part
|
|
*
|
|
* @return Category
|
|
*/
|
|
public function removePart(Part $part)
|
|
{
|
|
$this->parts->remove($part);
|
|
|
|
return $this;
|
|
}
|
|
}
|