foreignObject = $foreignObject; $this->localField = $localField; $this->remoteField = $remoteField; $this->localElement = $localElement; } function get() { return $this->foreignObject::findOne(Array($this->remoteField => Array('=', $this->localElement->{$this->localField}))); } }