Can't wrap my head around it. I more or less copied from the tutorial, but the profiler throws two errors:
AppBundle\Entity\Brand The association AppBundle\Entity\Brand#devices refers to the owning side field AppBundle\Entity\Device#brands which does not exist.
AppBundle\Entity\Device The association AppBundle\Entity\Device#brand refers to the inverse side field AppBundle\Entity\Brand#brands which does not exist.
class Brand {
/**
* @var int
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
...
/**
* @ORM\OneToMany(targetEntity="Device", mappedBy="brands")
*/
private $devices;
}
and
class Device {
/**
* @var int
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
...
/**
* @ORM\ManyToOne(targetEntity="Brand", inversedBy="devices")
* @ORM\JoinColumn(name="brand_id", referencedColumnName="id", nullable=true)
*/
private $brand;
}