public function beforeLoad($m, $q = null)
    {
        if (is_null($q)) {
            return;
        }  // manual load

        if ($this->m2 && $this->m2 != $this->owner->id_field) {
            $q->field($this->m2, $this->m1, $this->short_name);
        } elseif ($this->m2) {
            $q->field($this->f2, $this->fa ?: $this->f1, $this->short_name);
        }
    }
public function beforeLoad($m, $q = null)
    {
        if (is_null($q)) {
            return;
        }  // manual load

        if ($this->m2 && $this->m2 != $this->owner->id_field) {
            $q->field($this->m2, $this->m1, $this->short_name);
        } elseif ($this->m2) {
            $q->field($this->f2, $this->fa ?: $this->f1, $this->short_name);
        }
    }
public function beforeLoad ( $ m , $ q = null ) { if ( is_null ( $ q ) ) { return ; } // manual load if ( $ this -> m2 && $ this -> m2 != $ this -> owner -> id_field ) { $ q -> field ( $ this -> m2 , $ this -> m1 , $ this -> short_name ) ; } elseif ( $ this -> m2 ) { $ q -> field ( $ this -> f2 , $ this -> fa ? : $ this -> f1 , $ this -> short_name ) ; } }
Add query for the relation's ID, but then remove it from results. Remove ID when unloading.
Add query for the relation s ID but then remove it from results . Remove ID when unloading .