| 1 | <?php |
||
| 20 | class Insert extends Common\Insert implements Common\ReturningInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * |
||
| 24 | * Returns the proper name for passing to `PDO::lastInsertId()`. |
||
| 25 | * |
||
| 26 | * @param string $col The last insert ID column. |
||
| 27 | * |
||
| 28 | * @return string The sequence name "{$into_table}_{$col}_seq", or the |
||
| 29 | * value from `$last_insert_id_names`. |
||
| 30 | * |
||
| 31 | */ |
||
| 32 | 2 | public function getLastInsertIdName($col) |
|
| 33 | { |
||
| 34 | 2 | $name = parent::getLastInsertIdName($col); |
|
| 35 | 2 | if (! $name) { |
|
| 36 | 1 | $name = "{$this->into}_{$col}_seq"; |
|
| 37 | } |
||
| 38 | 2 | return $name; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * |
||
| 43 | * Adds returning columns to the query. |
||
| 44 | * |
||
| 45 | * Multiple calls to returning() will append to the list of columns, not |
||
| 46 | * overwrite the previous columns. |
||
| 47 | * |
||
| 48 | * @param array $cols The column(s) to add to the query. |
||
| 49 | * |
||
| 50 | * @return $this |
||
| 51 | * |
||
| 52 | */ |
||
| 53 | 1 | public function returning(array $cols) |
|
| 57 | } |
||
| 58 |