Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Druid/Query/Aggregation/GroupBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

namespace Druid\Query\Aggregation;


use Druid\Query\Component\DimensionSpecInterface;
use Druid\Query\Component\HavingInterface;
use Druid\Query\Component\LimitSpecInterface;
Expand Down
25 changes: 23 additions & 2 deletions src/Druid/Query/Aggregation/Timeseries.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

namespace Druid\Query\Aggregation;

use Druid\Query\Component\Descending\Descending;
use Druid\Query\Component\DescendingInterface;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\PreSerialize;
use JMS\Serializer\Annotation\PostSerialize;
use Druid\Query\Exception\RequiredArgumentException;

/**
Expand All @@ -49,11 +53,28 @@ public function __construct()

/**
* Whether to make descending ordered result. Default is false(ascending).
* @return bool
* @return DescendingInterface
*/
public function getDescending()
{
return $this->descending->getDescending();
return $this->descending;
}

/**
* @PreSerialize
*/
public function preSerialize()
{
$this->descending = $this->descending ? $this->descending->getDescending() : null;
}

/**
* @PostSerialize
*/
public function postSerialize()
{
/** @noinspection PhpParamsInspection */
!is_null($this->descending) && $this->setDescending(new Descending($this->descending));
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Druid/Query/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

namespace Druid\Query;


use Druid\Query\Exception\RequiredArgumentException;

/**
Expand Down
5 changes: 4 additions & 1 deletion src/Druid/QueryBuilder/TopNQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ public function setMetric(MetricInterface $metric)
*/
public function setThreshold($threshold)
{
return $this->addComponent('threshold', $threshold instanceof ThresholdInterface ? $threshold : new Threshold((int)$threshold));
return $this->addComponent(
'threshold',
$threshold instanceof ThresholdInterface ? $threshold : new Threshold((int)$threshold)
);
}

/**
Expand Down