finished Row
[mdref/mdref-pq-gateway] / pq-gateway / pq / Gateway / Row / ofWhich.md
1 # mixed pq\Gateway\Row::ofWhich(mixed $foreign[, string $ref = NULL])
2
3 Find the parent row by foreign key.
4 See pq\Gateway\Table::by().
5
6 ## Params:
7
8 * mixed $foreign
9 The foreign table (name).
10 * Optional string $ref = NULL
11 A specific relation name if there are more than one foreign keys to the same table.
12
13 ## Returns:
14
15 * a [deferred promise of React/Promise](https://github.com/reactphp/promise#deferred-1), when using pq\Query\AsyncExecutor, the asynchronous executor.
16 Else:
17 * pq\Result, if pq\Result::$status != pq\Result::TUPLES_OK.
18 * pq\Result, if the rowset prototype pq\Gateway\Table::$rowset is empty.
19 * pq\Gateway\Rowset, an instance of the rowset prototype.