# Attributed entities

**URL:** <https://forum.shopware.com/t/attributed-entities/105422>\
**Category:** Programming (EN)\
**Created:** [4. Oktober 2024 um 12:52 UTC](https://forum.shopware.com/t/attributed-entities/105422 "2024-10-04T12:52:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hashtag\_Assist](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Hashtag\_Assist](https://forum.shopware.com/u/Hashtag_Assist)\
**Post date:** [4. Oktober 2024 um 12:52 UTC](https://forum.shopware.com/t/attributed-entities/105422/1 "2024-10-04T12:52:11Z")

</div>

Hey, do I have to create an collection or something like this for attributed entities when I create a relation to a core entity?  
I have a custom entity with a OneToOne relation to the product but unfortunately I can’t find it with .addAssociation(‚accessories‘)

Here is my entity:

```auto
#[EntityAttribute('accessories')]
class AccessoriesEntity extends Entity{

    #[PrimaryKey]
    #[Field(type: FieldType::UUID, api: true)]
    public string $id;

    #[ForeignKey(entity: 'product', api: true)]
    public ?string $productId = null;

    #[OneToOne(entity: 'product', api: true, column:"product")]
    public ?ProductEntity $product = null;

    #[ReferenceVersion(entity: 'product')]
    public ?ProductEntity $ref = null;

}

```
