Ben Symfony1.4.1 kullanıyorum ve bu Doktrini 1.2.1 (Bence) kullanır.
Ben zaten var olanı bulduğumda tüm kendim yukarıda olduğu bir işlevi yapmak için çalışıyorlar.
Herhangi bir fonksiyon bu deneyin ve sonuçlarına bakmak:
$tmp=$this->toArray(TRUE);
var_dump($tmp);
$this->refreshRelated();
$tmp=$this->toArray();
var_dump($tmp);
$tmp=$this->toArray(TRUE);
var_dump($tmp);
exit();
Ben iki farklı şeyler denemek için gidiyorum:
A/ put $this->refreshRelated() into the constructor of all my model objects.
B/ write a function that takes an array depicting the object graph that I want populated. Calling the function refereshRelatedGraph($objectGraphArray). With the right structure of the array (having all the appropriate relation names at each level), I could control which relations get populated and which don't. One use for this is to populate only children, not parent relations. The other is for when a ERD/Schema/ObjectGraph has an element that is 'owned' by more than one object (many to many, other special circumstances that I have), I could control which side of the relationships get pre(non lazy) loaded.