for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ClientBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Category
* @ORM\Entity(repositoryClass="ClientBundle\Repository\CategoryRepository")
* @ORM\Table(name="category")
*/
class Category
{
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
private $id;
* @ORM\Column(type="string", length=50, nullable=false)
private $name;
* @ORM\ManyToMany(targetEntity="Client", mappedBy="categories")
private $clients;
* Constructor
public function __construct()
$this->clients = new ArrayCollection();
}
* Get id
*
* @return integer
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 (string) $this->getName();
* Add client
* @param \ClientBundle\Entity\Client $client
public function addClient(\ClientBundle\Entity\Client $client)
$this->clients[] = $client;
* Remove client
public function removeClient(\ClientBundle\Entity\Client $client)
$this->clients->removeElement($client);
* Get clients
* @return \Doctrine\Common\Collections\Collection
public function getClients()
return $this->clients;