for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\Foundry\Tests\Fixtures\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="roles")
*/
class Role
{
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
private $id;
* @ORM\Column(type="string")
private $name;
* @ORM\OneToOne(targetEntity=User::class, inversedBy="role")
* @ORM\JoinColumn(nullable=false)
private $user;
public function getId()
return $this->id;
}
public function getName()
return $this->name;
public function setName($name)
$this->name = $name;
public function getUser()
return $this->user;
public function setUser(User $user)
$this->user = $user;
if ($user->getRole() !== $this) {
$user->setRole($this);