-
-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mongodb date_immutable filter support
- Loading branch information
Jean-Pascal Devierne
committed
Jan 4, 2021
1 parent
4f05477
commit ac0befd
Showing
8 changed files
with
82 additions
and
2 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
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,57 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Document; | ||
|
||
use ApiPlatform\Core\Annotation\ApiFilter; | ||
use ApiPlatform\Core\Annotation\ApiResource; | ||
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Filter\DateFilter; | ||
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; | ||
|
||
/** | ||
* Dummy Date Immutable. | ||
* | ||
* | ||
* @ApiResource(attributes={ | ||
* "filters"={"my_dummy_immutable_date.mongodb.date"} | ||
* }) | ||
* | ||
* @ODM\Document | ||
*/ | ||
class DummyImmutableDate | ||
{ | ||
/** | ||
* @var int The id | ||
* | ||
* @ODM\Id(strategy="INCREMENT", type="integer") | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var \DateTimeImmutable The dummy date | ||
* | ||
* @ODM\Field(type="date_immutable") | ||
*/ | ||
public $dummyDate; | ||
|
||
/** | ||
* Get id. | ||
* | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
} |
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