---
url: /repositories.md
---
# Repositories (entity listings)

```twig
{% set newProducts = repository.product.findBy({ 'new': true, 'limit': 10 }) %}
Displayed: {{ newProducts|length }} {# outputs 0 to 10 #}
Total new: {{ newProducts.totalCount }} {# total count of new products - WARNING! Creates an extra database query, which can be more expensive than listing the first X items #}
```

## actuality

```twig
{% for actuality in repository.actuality.findBy({ ... }) %}
   {{actuality.id}}
{% endfor %}

{{ repository.actuality.findOneBy({  }) }}

{{ repository.actuality.count({  }) }}

{% if repository.actuality.count({  }) %}  {% endif %}
```

**Repository arguments for actuality**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| sort | newest, oldest | Sorting |
| limit | int | Maximum number of results |

## article

```twig
{% for article in repository.article.findBy({ ... }) %}
   {{article.id}}
{% endfor %}

{{ repository.article.findOneBy({  }) }}

{{ repository.article.count({  }) }}

{% if repository.article.count({  }) %}  {% endif %}
```

**Repository arguments for article**

| Argument | Type | Description |
|---|---|---|
| id | int, array | Article ID |
| skipId | int, array | Exclude article ID |
| topic | int | Article topic |
| author | int | Article author (id) |
| skipTopic | int, array | Exclude article topic |
| product | int | Product articles |
| category | int | Category articles |
| search | string | Contains phrase |
| sort | random, randomForVisitorDaily, randomVisitorHourly, name, newest, oldest | Sorting |
| limit | int | Maximum number of results |

## attribute

```twig
{% for attribute in repository.attribute.findBy({ ... }) %}
   {{attribute.id}}
{% endfor %}

{{ repository.attribute.findOneBy({  }) }}

{{ repository.attribute.count({  }) }}

{% if repository.attribute.count({  }) %}  {% endif %}
```

**Repository arguments for attribute**

| Argument | Type | Description |
|---|---|---|
| id | int, array | Attribute ID |
| skipId | int, array | Exclude attribute ID |
| type | int, array | Attribute type |
| section | int, array | Section |
| meaning | size, color, gender, material, pattern, age\_group, unknown | Meaning |
| namespace | product, store, article | Namespace |
| limit | int | Maximum number of results |

## attributeValue

```twig
{% for attributeValue in repository.attributeValue.findBy({ ... }) %}
   {{attributeValue.id}}
{% endfor %}

{{ repository.attributeValue.findOneBy({  }) }}

{{ repository.attributeValue.count({  }) }}

{% if repository.attributeValue.count({  }) %}  {% endif %}
```

**Repository arguments for attributeValue**

| Argument | Type | Description |
|---|---|---|
| id | int, array | Attribute value ID |
| skipId | int, array | Exclude attribute value ID |
| attribute | int, array | Attribute type |
| limit | int | Maximum number of results |

## author

```twig
{% for author in repository.author.findBy({ ... }) %}
   {{author.id}}
{% endfor %}

{{ repository.author.findOneBy({  }) }}

{{ repository.author.count({  }) }}

{% if repository.author.count({  }) %}  {% endif %}
```

**Repository arguments for author**

| Argument | Type | Description |
|---|---|---|
| id | int, array | Author ID |
| limit | int | Maximum number of results |

## banner

```twig
{% for banner in repository.banner.findBy({ ... }) %}
   {{banner.id}}
{% endfor %}

{{ repository.banner.findOneBy({  }) }}

{{ repository.banner.count({  }) }}

{% if repository.banner.count({  }) %}  {% endif %}
```

**Repository arguments for banner**

| Argument | Type | Description |
|---|---|---|
| id | int, array | Banner ID |
| sectionId | int | Section ID |
| sectionCode | string | Section code |
| category | int | Category ID (banners assigned to the category) |
| brand | int | Brand ID (banners assigned to the brand) |
| sort | random, priority | Sorting |
| limit | int | Maximum number of results |

## brand

```twig
{% for brand in repository.brand.findBy({ ... }) %}
   {{brand.id}}
{% endfor %}

{{ repository.brand.findOneBy({  }) }}

{{ repository.brand.count({  }) }}

{% if repository.brand.count({  }) %}  {% endif %}
```

**Repository arguments for brand**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| important | bool | Important |
| image | bool | Has image |
| search | string | Search by name |
| category | int | Category |
| sort | random, priority, name | Sorting |
| limit | int | Maximum number of results |

## category

```twig
{% for category in repository.category.findBy({ ... }) %}
   {{category.id}}
{% endfor %}

{{ repository.category.findOneBy({  }) }}

{{ repository.category.count({  }) }}

{% if repository.category.count({  }) %}  {% endif %}
```

**Repository arguments for category**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| parent | int | Parent category ID |
| important | bool | Important |
| active | bool | Active only (default true) |
| empty | bool | Empty? |
| alias | bool | Is alias of another category? |
| search | string | Search by name |
| brand | int | Only categories with products of the brand |
| level | int | Level (starts from 0) |
| path | string | All subcategories of the path |
| maximumLevel | int | Maximum level (inclusive; starts from 0) |
| sort | random, priority, name | Sorting |
| limit | int | Maximum number of results |

## comment

```twig
{% for comment in repository.comment.findBy({ ... }) %}
   {{comment.id}}
{% endfor %}

{{ repository.comment.findOneBy({  }) }}

{{ repository.comment.count({  }) }}

{% if repository.comment.count({  }) %}  {% endif %}
```

**Repository arguments for comment**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| for | Product, Category, Article | Comment subject (product, article, ...) |
| structured | bool | Output as structured tree |
| limit | int | Maximum number of results |

## compatibilityAttribute

```twig
{% for compatibilityAttribute in repository.compatibilityAttribute.findBy({ ... }) %}
   {{compatibilityAttribute.id}}
{% endfor %}

{{ repository.compatibilityAttribute.findOneBy({  }) }}

{{ repository.compatibilityAttribute.count({  }) }}

{% if repository.compatibilityAttribute.count({  }) %}  {% endif %}
```

**Repository arguments for compatibilityAttribute**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| sort | priority | Sorting |
| limit | int | Maximum number of results |

## compatibilityAttributeValue

```twig
{% for compatibilityAttributeValue in repository.compatibilityAttributeValue.findBy({ ... }) %}
   {{compatibilityAttributeValue.id}}
{% endfor %}

{{ repository.compatibilityAttributeValue.findOneBy({  }) }}

{{ repository.compatibilityAttributeValue.count({  }) }}

{% if repository.compatibilityAttributeValue.count({  }) %}  {% endif %}
```

**Repository arguments for compatibilityAttributeValue**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| attribute | int | Compatibility attribute ID |
| limit | int | Maximum number of results |

## dynamicCategory

```twig
{% for dynamicCategory in repository.dynamicCategory.findBy({ ... }) %}
   {{dynamicCategory.id}}
{% endfor %}

{{ repository.dynamicCategory.findOneBy({  }) }}

{{ repository.dynamicCategory.count({  }) }}

{% if repository.dynamicCategory.count({  }) %}  {% endif %}
```

**Repository arguments for dynamicCategory**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| category | int | Category ID |
| sort | name | Sorting |
| limit | int | Maximum number of results |

## label

```twig
{% for label in repository.label.findBy({ ... }) %}
   {{label.id}}
{% endfor %}

{{ repository.label.findOneBy({  }) }}

{{ repository.label.count({  }) }}

{% if repository.label.count({  }) %}  {% endif %}
```

**Repository arguments for label**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| sort | priority | Sorting |
| limit | int | Maximum number of results |

## loyaltyLevel

```twig
{% for loyaltyLevel in repository.loyaltyLevel.findBy({ ... }) %}
   {{loyaltyLevel.id}}
{% endfor %}

{{ repository.loyaltyLevel.findOneBy({  }) }}

{{ repository.loyaltyLevel.count({  }) }}

{% if repository.loyaltyLevel.count({  }) %}  {% endif %}
```

**Repository arguments for loyaltyLevel**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| type | invoice, receipt | Level type |
| limit | int | Maximum number of results |

## enum

```twig
{% for enum in repository.enum.findBy({ ... }) %}
   {{enum.id}}
{% endfor %}

{{ repository.enum.findOneBy({  }) }}

{{ repository.enum.count({  }) }}

{% if repository.enum.count({  }) %}  {% endif %}
```

**Repository arguments for enum**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| meaning | size, color, gender, material, pattern, age\_group, unknown | Meaning |
| sort | name | Sorting |
| limit | int | Maximum number of results |

## enumValue

```twig
{% for enumValue in repository.enumValue.findBy({ ... }) %}
   {{enumValue.id}}
{% endfor %}

{{ repository.enumValue.findOneBy({  }) }}

{{ repository.enumValue.count({  }) }}

{% if repository.enumValue.count({  }) %}  {% endif %}
```

**Repository arguments for enumValue**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| enum | int | Enum ID |
| sort | name, priority | Sorting |
| limit | int | Maximum number of results |

## product

```twig
{% for product in repository.product.findBy({ ... }) %}
   {{product.id}}
{% endfor %}

{{ repository.product.findOneBy({  }) }}

{{ repository.product.count({  }) }}

{% if repository.product.count({  }) %}  {% endif %}
```

**Repository arguments for product**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| skipId | int, array | Skip product ID |
| category | int, array | Category ID |
| subcategories | bool | Include products from subcategories |
| skipCategory | int | Skip main category ID |
| inStock | bool | Only products in stock |
| sellout | bool | Clearance sale |
| bestseller | bool | Bestseller |
| discount | bool | On sale |
| promo | bool | Promo |
| promoCategory | int | Promo for category |
| new | bool | New arrival |
| viewed | bool | Recently viewed products |
| wished | bool | Wishlist |
| image | bool | Products with image |
| recommendHomepage | bool | Recommend products for user homepage (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendCart | bool | Recommend products for user cart (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendSimilar | int | Recommend similar products for product ID (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendCrossSell | int | Recommend cross-sell products for product ID (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendDefault | int | Recommend products for product ID (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendCartDialog | int | Recommend products for the after-add-to-cart dialog of the added product ID (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendBuyAgain | bool | Recommend the signed-in customer's own past purchases that are due again — empty for anonymous visitors (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| recommendPostPurchase | int | Recommend add-ons to the just-placed order ID on the order-confirmation page — empty unless the order is the visitor's own (lazy-load via i:dynamic lazy="auto", set limit to the tiles shown, max 20) |
| file | bool, string | Products with file (can filter file type - manual, etc.) |
| video | bool | Products with video |
| search | string | Contains phrase |
| priceFrom | float | Minimum price |
| priceTo | float | Maximum price |
| brand | int, array | Brand ID |
| article | int | Article ID |
| label | int, array | Label ID |
| skipLabel | int, array | Excluded label ID |
| customersAlsoBought | int | Product ID to find frequently bought together items |
| relevant | int, Product | Related products for product ID |
| accessory | int, Product | Accessories for product ID |
| similar | int, Product | Similar products for product ID |
| bundleContainsProduct | Product | Bundles containing the product |
| enums | array | Array of enums with value IDs |
| attributes | array | Array of attributes with value IDs |
| boolAttributes | array | Array of attribute IDs |
| skipBoolAttributes | array | Array of attribute IDs whose yes/no value is not yes |
| sort | priority, newest, random, randomForVisitorDaily, randomForVisitorHourly, lastStockIn, name, price, priceDesc, bestseller | Sorting |
| limit | int | Maximum number of results |
| fulltextContext | string | Internal fulltext query context |

## review

```twig
{% for review in repository.review.findBy({ ... }) %}
   {{review.id}}
{% endfor %}

{{ repository.review.findOneBy({  }) }}

{{ repository.review.count({  }) }}

{% if repository.review.count({  }) %}  {% endif %}
```

**Repository arguments for review**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| type | order, product | Review type |
| rel | int | Reviewed object ID (product) |
| text | bool | Only reviews with text |
| anyText | bool | Only reviews with description, pros or cons |
| minimalRating | int | Only with higher rating |
| sort | oldest, newest | Sorting |
| limit | int | Maximum number of results |

## storageCenter

```twig
{% for storageCenter in repository.storageCenter.findBy({ ... }) %}
   {{storageCenter.id}}
{% endfor %}

{{ repository.storageCenter.findOneBy({  }) }}

{{ repository.storageCenter.count({  }) }}

{% if repository.storageCenter.count({  }) %}  {% endif %}
```

**Repository arguments for storageCenter**

| Argument | Type | Description |
|---|---|---|
| limit | int | Maximum number of results |

## storageRoom

```twig
{% for storageRoom in repository.storageRoom.findBy({ ... }) %}
   {{storageRoom.id}}
{% endfor %}

{{ repository.storageRoom.findOneBy({  }) }}

{{ repository.storageRoom.count({  }) }}

{% if repository.storageRoom.count({  }) %}  {% endif %}
```

**Repository arguments for storageRoom**

| Argument | Type | Description |
|---|---|---|
| limit | int | Maximum number of results |

## store

```twig
{% for store in repository.store.findBy({ ... }) %}
   {{store.id}}
{% endfor %}

{{ repository.store.findOneBy({  }) }}

{{ repository.store.count({  }) }}

{% if repository.store.count({  }) %}  {% endif %}
```

**Repository arguments for store**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| attributeValue | int, array | Attribute values |
| pickup | bool | Pickup available? |
| country | string, array | Country code |
| closestToPoint | array | Sort from closest to point \[latitude, longitude] |
| sort | priority, name | Sorting |
| limit | int | Maximum number of results |

## textPage

```twig
{% for textPage in repository.textPage.findBy({ ... }) %}
   {{textPage.id}}
{% endfor %}

{{ repository.textPage.findOneBy({  }) }}

{{ repository.textPage.count({  }) }}

{% if repository.textPage.count({  }) %}  {% endif %}
```

**Repository arguments for textPage**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| code | string, array | Code |
| search | string | Search by name and text; only pages marked searchable in administration |
| limit | int | Maximum number of results |

## articleTopic

```twig
{% for articleTopic in repository.articleTopic.findBy({ ... }) %}
   {{articleTopic.id}}
{% endfor %}

{{ repository.articleTopic.findOneBy({  }) }}

{{ repository.articleTopic.count({  }) }}

{% if repository.articleTopic.count({  }) %}  {% endif %}
```

**Repository arguments for articleTopic**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| sort | name, priority | Sorting |
| limit | int | Maximum number of results |

## variant

```twig
{% for variant in repository.variant.findBy({ ... }) %}
   {{variant.id}}
{% endfor %}

{{ repository.variant.findOneBy({  }) }}

{{ repository.variant.count({  }) }}

{% if repository.variant.count({  }) %}  {% endif %}
```

**Repository arguments for variant**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| product | int | Product ID |
| enumValue | int, array | Enum value ID |
| sort | name, priority, price | Sorting |
| limit | int | Maximum number of results |

## video

```twig
{% for video in repository.video.findBy({ ... }) %}
   {{video.id}}
{% endfor %}

{{ repository.video.findOneBy({  }) }}

{{ repository.video.count({  }) }}

{% if repository.video.count({  }) %}  {% endif %}
```

**Repository arguments for video**

| Argument | Type | Description |
|---|---|---|
| id | int, array | ID |
| type | category, product, other | Video type |
| sort | newest, oldest, priority | Sorting |
| limit | int | Maximum number of results |
