getName() . ' (' . count( $this->getProducts() ) . ' produits)'; } /** * @return mixed */ public function getUsers() { return $this->users; } /** * @param mixed $users */ public function setUsers( $users ) { $this->users = $users; } /** * @return mixed */ public function getProducts() { return $this->products; } /** * @param mixed $products */ public function setProducts( $products ) { $this->products = $products; } /** * @return mixed */ public function getId() { return $this->id; } /** * @param mixed $id */ public function setId( $id ) { $this->id = $id; } /** * @return mixed */ public function getName() { return $this->name; } /** * @param mixed $name */ public function setName( $name ) { $this->name = $name; } /** * Constructor */ public function __construct() { $this->products = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Add product * * @param \AppBundle\Entity\Product $product * * @return ProductCategory */ public function addProduct( \AppBundle\Entity\Product $product ) { $this->products[] = $product; return $this; } /** * Remove product * * @param \AppBundle\Entity\Product $product */ public function removeProduct( \AppBundle\Entity\Product $product ) { $this->products->removeElement( $product ); } /** * Add user * * @param \AppBundle\Entity\User $user * * @return ProductCategory */ public function addUser( \AppBundle\Entity\User $user ) { $this->users[] = $user; return $this; } /** * Remove user * * @param \AppBundle\Entity\User $user */ public function removeUser( \AppBundle\Entity\User $user ) { $this->users->removeElement( $user ); } }