UidFilter

Should be used to filter items by uid property. In fact it only extends NumericFilter but beside adding new condition into SQL's WHERE clause it also modifies Extbase's Query Settings to make it possible to find translated records by passing default language record uid value. Modification in Query Settings are exactly the same as modifications which are applied when \TYPO3\CMS\Extbase\Persistence\Repository::findByUid is called.

An example - if default record uid is 8 and uid for translated record is 10 and you are doing request for translation (see how multilanguage works in t3api) then you could add a param uid with value 8 (?uid=8 or ?uid[]=8). If you would use NumericFilter in same example, then it would be needed to set uid param to 10 (otherwise record would not be included in response).

Syntax: ?property=<int> or ?property[]=<int>&property[]=<int>.

use SourceBroker\T3api\Annotation as T3api;
use SourceBroker\T3api\Filter\UidFilter;

/**
 * @T3api\ApiResource (
 *     collectionOperations={
 *          "get"={
 *              "path"="/news/news",
 *          },
 *     },
 * )
 *
 * @T3api\ApiFilter(
 *     UidFilter::class,
 *     properties={"uid"},
 * )
 */
 class News extends \GeorgRinger\News\Domain\Model\News
 {
 }
Copied!