flux-querybuilder/src/Functions/First.php
David Arendsen fc99922700 Add addCount, addFirst, addMax, and addMin functions
Signed-off-by: David Arendsen <darendsen@gamepoint.com>
2023-02-12 17:43:47 +01:00

27 lines
475 B
PHP

<?php
namespace Arendsen\FluxQueryBuilder\Functions;
use Arendsen\FluxQueryBuilder\Type;
class First extends Base
{
/**
* @var string|null $column
*/
private $column;
public function __construct(?string $column = null)
{
$this->column = $column;
}
public function __toString()
{
$params = new Type(array_filter([
'column' => $this->column
]));
return '|> first(' . $params . ') ';
}
}