0
I have a problem that is analogous to the following situation:
A car may or may not have a driver, or a car may have at least 0 and at most 1 driver.
A driver may or may not have a car, ie a driver may have at least 0 and at most 1 car.
In the example in question we are accepting that the driver may have in the max a car.
Turning this into a class we would then have two classes.
<?php
class Carro{
/**
* esse deve aceitar null
*/
private $motorista;
}
class Motorista{
/**
* esse deve aceitar null
*/
private $carro;
}
In my view the mapping that would interest me most would be Onetoone, but I don’t know if it should be Onetomany or Manytoone, if it were possible to get him to accept null values, however, I would like to know what is the best way to do using Doctrine and the most correct form according to Designer Partner (I wonder because it may be that the best way to do using Doctrine is not the most correct way).