protected function load_result_self(&$result) { // Load objects : parent::load_result_self($result); // Load relationships : $direct = $this->relationship; $reverse = $this->relationship->reverse(); $src_key = $this->src_set->name() . ':__object'; $trg_key = $this->trg_set->name() . ':__object'; foreach ($result as $row) { $src_obj = isset($row[$src_key]) ? $row[$src_key] : null; $trg_obj = isset($row[$trg_key]) ? $row[$trg_key] : null; $direct->link($src_obj, $trg_obj); $reverse->link($trg_obj, $src_obj); } }