1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php namespace Illuminate\Database\Query\Processors;
use Illuminate\Database\Query\Builder;
class SqlServerProcessor extends Processor {
/** * Process an "insert get ID" query. * * @param \Illuminate\Database\Query\Builder $query * @param string $sql * @param array $values * @param string $sequence * @return int */ public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) { $query->getConnection()->insert($sql, $values);
$id = $query->getConnection()->getPdo()->lastInsertId();
return is_numeric($id) ? (int) $id : $id; }
/** * Process the results of a column listing query. * * @param array $results * @return array */ public function processColumnListing($results) { return array_values(array_map(function($r) { return $r->name; }, $results)); }
}
|