-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from sitepark/feature/date-filter-and-facets
feat: date filter and facets
- Loading branch information
Showing
56 changed files
with
2,047 additions
and
926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Atoolo\Search\Dto\Search\Query; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
enum DateRangeRound : string | ||
{ | ||
case START_OF_DAY = 'START_OF_DAY'; | ||
case START_OF_PREVIOUS_DAY = 'START_OF_PREVIOUS_DAY'; | ||
case END_OF_DAY = 'END_OF_DAY'; | ||
case END_OF_PREVIOUS_DAY = 'END_OF_PREVIOUS_DAY'; | ||
case START_OF_MONTH = 'START_OF_MONTH'; | ||
case START_OF_PREVIOUS_MONTH = 'START_OF_PREVIOUS_MONTH'; | ||
case END_OF_MONTH = 'END_OF_MONTH'; | ||
case END_OF_PREVIOUS_MONTH = 'END_OF_PREVIOUS_MONTH'; | ||
case START_OF_YEAR = 'START_OF_YEAR'; | ||
case START_OF_PREVIOUS_YEAR = 'START_OF_PREVIOUS_YEAR'; | ||
case END_OF_YEAR = 'END_OF_YEAR'; | ||
case END_OF_PREVIOUS_YEAR = 'END_OF_PREVIOUS_YEAR'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Atoolo\Search\Dto\Search\Query\Facet; | ||
|
||
use DateInterval; | ||
use DateTime; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
class AbsoluteDateRangeFacet extends Facet | ||
{ | ||
/** | ||
* @param string[] $excludeFilter | ||
*/ | ||
public function __construct( | ||
string $key, | ||
public readonly DateTime $from, | ||
public readonly DateTime $to, | ||
public readonly ?DateInterval $gap, | ||
array $excludeFilter = [] | ||
) { | ||
parent::__construct( | ||
$key, | ||
$excludeFilter | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Atoolo\Search\Dto\Search\Query\Facet; | ||
|
||
use Atoolo\Search\Dto\Search\Query\DateRangeRound; | ||
use DateInterval; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
class RelativeDateRangeFacet extends Facet | ||
{ | ||
/** | ||
* @param string[] $excludeFilter | ||
*/ | ||
public function __construct( | ||
string $key, | ||
public readonly ?\DateTime $base, | ||
public readonly ?DateInterval $before, | ||
public readonly ?DateInterval $after, | ||
public readonly ?DateInterval $gap, | ||
public readonly ?DateRangeRound $roundStart, | ||
public readonly ?DateRangeRound $roundEnd, | ||
array $excludeFilter = [] | ||
) { | ||
parent::__construct( | ||
$key, | ||
$excludeFilter | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.