| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function getSql(SqlWalker $sqlWalker): string |
||
| 38 | { |
||
| 39 | $platformName = $sqlWalker->getConnection()->getDatabasePlatform()->getName(); |
||
| 40 | |||
| 41 | switch ($platformName) { |
||
| 42 | case 'mysql': |
||
| 43 | return sprintf('DAY(%s)', $sqlWalker->walkArithmeticPrimary($this->date)); |
||
| 44 | |||
| 45 | case 'postgresql': |
||
| 46 | return sprintf('EXTRACT(DAY FROM %s)', $sqlWalker->walkArithmeticPrimary($this->date)); |
||
| 47 | } |
||
| 48 | |||
| 49 | throw new \RuntimeException(sprintf('Platform "%s" is not supported!', $platformName)); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |