> For the complete documentation index, see [llms.txt](https://metabolism.gitbook.io/symfony-wordpress-bundle/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metabolism.gitbook.io/symfony-wordpress-bundle/reference/repository/termrepository.md).

# TermRepository

{% hint style="info" %}
[WP\_Term\_Query](https://developer.wordpress.org/reference/classes/wp_term_query/) Wordpress wrapper to query objects
{% endhint %}

## Methods

#### count([$criteria](https://developer.wordpress.org/reference/classes/WP_Term_Query/__construct/#parameters))

Counts entities by a set of criteria.

#### find($id)

Finds an entity by its primary key / identifier.

#### findAll($orderBy, $public=true)

Finds all public entities in the repository.

#### findBy([$criteria](https://developer.wordpress.org/reference/classes/WP_Term_Query/__construct/#parameters), $orderBy, $limit, $offset)

Finds entities by a set of criteria.

#### findOneBy([$criteria](https://developer.wordpress.org/reference/classes/WP_Term_Query/__construct/#parameters), $orderBy)

Finds a single entity by a set of criteria.

#### findQueried()

Finds a single entity related to the main query

#### findTaxonomies($args=\[], $output='names', $operator='and')

Retrieves a list of registered taxonomy names or objects.

## Example

```php
public function pageAction(Post $post, TermRepository $termRepository)
{
  $context = [
    'post'=>$post,
    'tags'=>$termRepository->findBy(['taxonomy'=>'tag'],['title'=>'ASC'], 3)
  ];
  
  return $this->render('single.html.twig', $context);
}
```
