Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Category
- *
- * @ORM\Table(name="categories")
- * @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;
- /**
- * @ORM\OneToMany(targetEntity="AppBundle\Entity\Product", mappedBy="category")
- */
- private $products;
- /**
- * 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;
- }
- public function __toString()
- {
- return $this->name;
- }
- /**
- * @return mixed
- */
- public function getProducts()
- {
- return $this->products;
- }
- /**
- * @param mixed $products
- */
- public function setProducts($products)
- {
- $this->products = $products;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement