public function ref($defaults = []) : Model
    {
        $m = parent::ref($defaults);

        // If model is not loaded, then we are probably doing deep traversal
        if (!$this->owner->loaded() && isset($this->owner->persistence) && $this->owner->persistence instanceof Persistence_SQL) {
            $values = $this->owner->action('field', [$this->our_field]);

            return $m->addCondition($this->their_field ?: $m->id_field, $values);
        }

        return $m;
    }
public function ref($defaults = []) : Model
    {
        $m = parent::ref($defaults);

        // If model is not loaded, then we are probably doing deep traversal
        if (!$this->owner->loaded() && isset($this->owner->persistence) && $this->owner->persistence instanceof Persistence_SQL) {
            $values = $this->owner->action('field', [$this->our_field]);

            return $m->addCondition($this->their_field ?: $m->id_field, $values);
        }

        return $m;
    }
public function ref ( $ defaults = [ ] ) : Model { $ m = parent :: ref ( $ defaults ) ; // If model is not loaded, then we are probably doing deep traversal if ( ! $ this -> owner -> loaded ( ) && isset ( $ this -> owner -> persistence ) && $ this -> owner -> persistence instanceof Persistence_SQL ) { $ values = $ this -> owner -> action ( 'field' , [ $ this -> our_field ] ) ; return $ m -> addCondition ( $ this -> their_field ? : $ m -> id_field , $ values ) ; } return $ m ; }
Navigate to referenced model.

@param array $defaults Properties

@return Model
Navigate to referenced model .