# Repository custom fetching methods

## TLDR

```php

// \AutoAdmin\Bundle\Content\Repository\AbstractContentRepository::contentFindBy
// will retrieve content only using model "implicit"/"required" contracts, like:
// - \AutoAdmin\Bundle\Content\Model\SiteInterface (always there if extending one of the base content classes: \AutoAdmin\Bundle\Content\Entity\Content, \AutoAdmin\Bundle\Content\Entity\AbstractUntranslated)
// - translation contract (if extending \AutoAdmin\Bundle\Content\Entity\AbstractTranslatable) 

// \AutoAdmin\Bundle\Content\Repository\AbstractContentRepository::autoContentFindBy
// will retrieve content using implicit contracts + model contracts like:
// - \AutoAdmin\Bundle\Content\Model\PublishableInterface
// - \AutoAdmin\Bundle\Content\Model\PublishTimePeriodInterface

```

---

## Introduction

Permit to use improved repository methods for content fetching.

## Principle

3 ways of querying in AA:

- classic symfony repository findBy, retrieve all contents without following AA rules
- AbstractContentRepository::contentFindBy, retrieve contents following basic AA content rules like SiteInterface
  contract
- AbstractContentRepository::autoContentFindBy, retrieve contents following basic AA rules + model contracts like
  PublishableInterface

Those methods have their counterpart for Query Builders.
cf. \AutoAdmin\Bundle\Content\Repository\AbstractContentRepository