Skip to content

Commit 64d08c7

Browse files
committed
Merge branch 'feature/db-query' of https://github.com/5am-code/laravel-notion-api into feature/db-query
2 parents 67f9d36 + 9bdfc75 commit 64d08c7

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/Query/Filter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
class Filter extends QueryHelper
66
{
77

8+
public function __construct(string $property )
9+
{
10+
parent::__construct();
11+
12+
$this->property = $property;
13+
14+
15+
}
816

917

1018
}

src/Query/QueryHelper.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,20 @@ class QueryHelper
2929
*/
3030
protected Collection $validDirections;
3131

32+
/**
33+
* Contains all valid/implemented filter types.
34+
*
35+
* @see https://developers.notion.com/reference/post-database-query#post-database-query-filter
36+
* @var Collection
37+
*/
38+
protected Collection $validFilterTypes;
39+
3240

3341
public function __construct()
3442
{
3543
$this->validTimestamps = collect(["created_time", "last_edited_time"]);
3644
$this->validDirections = collect(["ascending", "descending"]);
45+
46+
3747
}
3848
}

src/Query/Sorting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public function __construct(string $direction, string $property = null, string $
3131
$this->direction = $direction;
3232
}
3333

34-
public static function timestampSort(string $timestampToSort, string $direction)
34+
public static function timestampSort(string $timestampToSort, string $direction): Sorting
3535
{
3636
$propertySort = new Sorting($direction, null, $timestampToSort);
3737

3838
return $propertySort;
3939
}
4040

41-
public static function propertySort(string $property, string $direction)
41+
public static function propertySort(string $property, string $direction): Sorting
4242
{
4343
$propertySort = new Sorting($direction, $property);
4444

0 commit comments

Comments
 (0)