Default Doctrine Annotation for single object relation should be derived automatically
* @var \Me\MyPackage\Domain\Model\DepartmentPerson
protected $departmentPerson = NULL;
Will result in strange errors that are not really helpful. Should by default create OneToOne or ManyToOne (maybe better) Relation (tbd) or at least give some warning on compile?
Updated by Sascha Egerer about 10 years ago
I got the same case wich throws a "Object of class XXX\XXX\Domain\Model\ClassName could not be converted to string" exception.
But I think it's a better idea to throw an exception in this case, wich explains that there is something missing for the relation.
Updated by Karsten Dambekalns about 10 years ago
- Category set to Persistence
- Status changed from New to Needs Feedback
- Assignee set to Karsten Dambekalns
Since there cannot be a reasonable default (
OneToOne vs @ManyToOne) this will not be changed. Also, you *could* actually want to store "objects as strings" using @__toString(), so an exception during compile is not an option either.
Any better ideas?