Conditions | 5 |
Paths | 3 |
Total Lines | 26 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function sqlStatement(AbstractCompiler $compiler = null): string |
||
24 | { |
||
25 | if ( |
||
26 | !$this->driver instanceof PostgresDriver |
||
27 | || (!empty($compiler) && !$compiler instanceof PostgresCompiler) |
||
28 | ) { |
||
29 | throw new BuilderException( |
||
30 | 'Postgres InsertQuery can be used only with Postgres driver and compiler' |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | if (empty($compiler)) { |
||
35 | $compiler = $this->compiler->resetQuoter(); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @var PostgresDriver $driver |
||
40 | * @var PostgresCompiler $compiler |
||
41 | */ |
||
42 | return $compiler->compileInsert( |
||
43 | $this->table, |
||
44 | $this->columns, |
||
45 | $this->rowsets, |
||
46 | $this->driver->getPrimary($this->compiler->getPrefix(), $this->table) |
||
47 | ); |
||
48 | } |
||
49 | |||
61 |