how to deal with doctrine's lazy loading when having null-objects?
问题 i have a question about the correct way to handle doctrine's lazy loading mechanism. I have an entity that references another one via @ManyToOne: class Entity { ... /** * @ManyToOne(targetEntity="AnotherEntity") * @JoinColumn(name="anotherEntityId", referencedColumnName="id") */ protected $anotherEntity; ... } class AnotherEntity { /** * @var integer $id * @Column(name="id", type="integer", nullable=false) * @Id * @GeneratedValue(strategy="IDENTITY") */ private $id; /** * @var string