Add duplicate() function to Query Builder
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
f2b3871b21
commit
2cca3daa17
4 changed files with 72 additions and 3 deletions
35
src/Functions/Duplicate.php
Normal file
35
src/Functions/Duplicate.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace Arendsen\FluxQueryBuilder\Functions;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Type;
|
||||
use Arendsen\FluxQueryBuilder\Type\ArrayType;
|
||||
|
||||
class Duplicate extends Base
|
||||
{
|
||||
/**
|
||||
* @var string $column
|
||||
*/
|
||||
private $column;
|
||||
|
||||
/**
|
||||
* @var string $as
|
||||
*/
|
||||
private $as;
|
||||
|
||||
public function __construct(string $column, string $as)
|
||||
{
|
||||
$this->column = $column;
|
||||
$this->as = $as;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$input = new ArrayType([
|
||||
'column' => $this->column,
|
||||
'as' => $this->as
|
||||
]);
|
||||
|
||||
return '|> duplicate(' . $input . ') ';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue