Skip to content

Commit

Permalink
118. ApiFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
teebbstudios committed Aug 2, 2021
1 parent 2c0b5f9 commit 4ae1b6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions src/Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use App\Repository\CommentRepository;
use App\Utils\DateTimeTrait;
use Doctrine\Common\Collections\ArrayCollection;
Expand All @@ -17,6 +19,10 @@
* @Assert\EnableAutoMapping
*/
#[ApiResource]
#[ApiFilter(SearchFilter::class, properties: [
'message' => 'partial',
'post.id' => 'exact'
])]
class Comment
{
use DateTimeTrait;
Expand Down

0 comments on commit 4ae1b6b

Please sign in to comment.