| Q | A
|------------ | ------
| New Feature | yes
| RFC | no
| BC Break | no
When declaring a type on a property, this should act as a default for field type or ManyToOne/OneToOne targetEntity.
class User
{
/** @ORM\Column */
public int $id; // defaults to type="integer"
/** @ORM\ManyToOne */
public Email $email; // defaults to targetEntity=Email::class
}
The relevant code would be in ClassMetadataInfo::mapField, mapManyToOne and mapOneToOne. Whenever type or targetEntity is missing, it could look this up in reflection property instead if it has a type.
Could we expect it'll also detect nullable properties?
/** @ORM\Column */
public ?string $name;
Most helpful comment
Could we expect it'll also detect
nullableproperties?