Marks fork as 2.0.0.
This commit is contained in:
parent
d93a6b5c09
commit
8d8de4a2b0
81 changed files with 1921 additions and 3954 deletions
|
|
@ -1,51 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Arendsen\FluxQueryBuilder\Functions;
|
||||
namespace Hosterra\FluxBuilder\Functions;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Type;
|
||||
use Arendsen\FluxQueryBuilder\Type\ArrayType;
|
||||
use Arendsen\FluxQueryBuilder\Type\CustomType;
|
||||
use Arendsen\FluxQueryBuilder\Type\DurationType;
|
||||
use Arendsen\FluxQueryBuilder\Type\FnType;
|
||||
use Hosterra\FluxBuilder\Type;
|
||||
use Hosterra\FluxBuilder\Type\ArrayType;
|
||||
use Hosterra\FluxBuilder\Type\CustomType;
|
||||
use Hosterra\FluxBuilder\Type\DurationType;
|
||||
use Hosterra\FluxBuilder\Type\FnType;
|
||||
|
||||
class AggregateWindow extends Base
|
||||
{
|
||||
/**
|
||||
* @var string $every
|
||||
*/
|
||||
private $every;
|
||||
class AggregateWindow extends Base {
|
||||
/**
|
||||
* @var string $every
|
||||
*/
|
||||
private $every;
|
||||
|
||||
/**
|
||||
* @var string $fn
|
||||
*/
|
||||
private $fn;
|
||||
/**
|
||||
* @var string $fn
|
||||
*/
|
||||
private $fn;
|
||||
|
||||
/**
|
||||
* @var array $options
|
||||
*/
|
||||
private $options;
|
||||
/**
|
||||
* @var array $options
|
||||
*/
|
||||
private $options;
|
||||
|
||||
public function __construct($every, $fn, array $options = [])
|
||||
{
|
||||
$this->every = $every;
|
||||
$this->fn = $fn;
|
||||
$this->options = $options;
|
||||
}
|
||||
public function __construct( $every, $fn, array $options = [] ) {
|
||||
$this->every = $every;
|
||||
$this->fn = $fn;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$input = new ArrayType(array_filter([
|
||||
'every' => new DurationType($this->every),
|
||||
'period' => isset($this->options['period']) ? new DurationType($this->options['period']) : null,
|
||||
'offset' => isset($this->options['offset']) ? new DurationType($this->options['offset']) : null,
|
||||
'fn' => new CustomType($this->fn),
|
||||
'location' => isset($this->options['location']) ? new Type($this->options['location']) : null,
|
||||
'column' => isset($this->options['column']) ? new Type($this->options['column']) : null,
|
||||
'timeSrc' => isset($this->options['timeSrc']) ? new Type($this->options['timeSrc']) : null,
|
||||
'timeDst' => isset($this->options['timeDst']) ? new Type($this->options['timeDst']) : null,
|
||||
'createEmpty' => isset($this->options['createEmpty']) && !$this->options['createEmpty'] ?
|
||||
new Type($this->options['createEmpty']) : null,
|
||||
]));
|
||||
return '|> aggregateWindow(' . $input . ') ';
|
||||
}
|
||||
public function __toString() {
|
||||
$input = new ArrayType( array_filter( [
|
||||
'every' => new DurationType( $this->every ),
|
||||
'period' => isset( $this->options['period'] ) ? new DurationType( $this->options['period'] ) : null,
|
||||
'offset' => isset( $this->options['offset'] ) ? new DurationType( $this->options['offset'] ) : null,
|
||||
'fn' => new CustomType( $this->fn ),
|
||||
'location' => isset( $this->options['location'] ) ? new Type( $this->options['location'] ) : null,
|
||||
'column' => isset( $this->options['column'] ) ? new Type( $this->options['column'] ) : null,
|
||||
'timeSrc' => isset( $this->options['timeSrc'] ) ? new Type( $this->options['timeSrc'] ) : null,
|
||||
'timeDst' => isset( $this->options['timeDst'] ) ? new Type( $this->options['timeDst'] ) : null,
|
||||
'createEmpty' => isset( $this->options['createEmpty'] ) && ! $this->options['createEmpty'] ?
|
||||
new Type( $this->options['createEmpty'] ) : null,
|
||||
] ) );
|
||||
|
||||
return '|> aggregateWindow(' . $input . ') ';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue