function by(Row $foreign, $ref = null) {
		// select * from $this where $this->$referencedColumn = $me->$foreignColumn
		
		if (!($rel = $foreign->getTable()->getRelation($this->getName(), $ref))) {
			return $this->onResult(null);
		}
		
		$where = array();
		foreach ($rel as $key => $ref) {
			$where["$ref="] = $foreign->$key;
		}
		return $this->find($where);
	}
function by(Row $foreign, $ref = null) {
		// select * from $this where $this->$referencedColumn = $me->$foreignColumn
		
		if (!($rel = $foreign->getTable()->getRelation($this->getName(), $ref))) {
			return $this->onResult(null);
		}
		
		$where = array();
		foreach ($rel as $key => $ref) {
			$where["$ref="] = $foreign->$key;
		}
		return $this->find($where);
	}
function by ( Row $ foreign , $ ref = null ) { // select * from $this where $this->$referencedColumn = $me->$foreignColumn if ( ! ( $ rel = $ foreign -> getTable ( ) -> getRelation ( $ this -> getName ( ) , $ ref ) ) ) { return $ this -> onResult ( null ) ; } $ where = array ( ) ; foreach ( $ rel as $ key => $ ref ) { $ where [ "$ref=" ] = $ foreign -> $ key ; } return $ this -> find ( $ where ) ; }
Get the parent rows of a row by foreign key
@param \pq\Gateway\Row $foreign
@param string $ref
@return mixed
Get the parent rows of a row by foreign key