Skip to content

Commit 9990265

Browse files
authored
Merge pull request #269 from vincentchalamon/issues/1246
[RFR] Add doc on api-platform/code#1246
2 parents e651ec6 + 0a55aca commit 9990265

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

core/default-order.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,29 @@ class Book
5959
}
6060
```
6161

62+
It's also possible to configure the default filter on an association property:
63+
64+
<?php
65+
66+
// src/AppBundle/Entity/Book.php
67+
68+
namespace AppBundle\Entity;
69+
70+
use ApiPlatform\Core\Annotation\ApiResource;
71+
72+
/**
73+
* @ApiResource(attributes={"order"={"author.username"}})
74+
*/
75+
class Book
76+
{
77+
// ...
78+
79+
/**
80+
* @var User
81+
*/
82+
public $author;
83+
}
84+
6285
Previous chapter: [Operations](operations.md)
6386
6487
Next chapter: [Filters](filters.md)

0 commit comments

Comments
 (0)