Implementing ChannelAware
Defining channel-aware entities
Making an entity channel-aware means that it can be associated with a specific Channel.
This is useful when you want to have different data or features for different channels. First you will have to create
an entity (Define a database entity) that implements the ChannelAware interface.
This interface requires the entity to provide a channels property
Creating channel-aware entities
Creating a channel-aware entity is similar to creating a regular entity. The only difference is that you need to assign the entity to the current channel.
This can be done by using the ChannelService which provides the assignToCurrentChannel helper function.
The assignToCurrentChannel function will only assign the channels property of the entity. You will still need to save the entity to the database.
For Translatable entities, the best place to assign the channels is inside the beforeSave input of the TranslatableSaver helper class.
Querying channel-aware entities
When querying channel-aware entities, you can use the ListQueryBuilder or the TransactionalConnection to automatically filter entities based on the provided channel id.