StoreMapping - EntityId

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hello, I'm trying to understand the relationship of EntityId to stores and users.  I see there are multiple tables where the EntityId is used but I don't see where the EntityId is created.  Thank you for any insights you can shed on the topic.
5 years ago
Search for InsertStoreMapping
as in        
public virtual void InsertStoreMapping<T>(T entity, int storeId) where T : BaseEntity, IStoreMappingSupported

When a store mapping is inserted then the EnityId is set to the Id for the Item being mapped to a Store
i.e. the Id for the Topic, Category, Newsitem, etc
5 years ago
Hi Yidna, thanks for the reply.  Does that mean that all objects get mapped to a store when they're created?  I guess I'm still unclear on what an entity actually represents.

Thanks again,

Adam
5 years ago
The default is no mapping to any store.
Only when you map items to a store (Use the Limited to stores field) will there be entries made in the table
5 years ago
It must also be noted that not all entities are "Limited to store". Just a few of them are.

adam9367 wrote:
Hi Yidna, thanks for the reply.  Does that mean that all objects get mapped to a store when they're created?  I guess I'm still unclear on what an entity actually represents.

Thanks again,

Adam



5 years ago
I have an existing custom CMS that I have multiple customers logging into for managing content.   (It's a multi-site CMS for hosting websites)  Each customer uploads their data into a single database using my tools, and then I use their data to generate individual websites for them based off of web address.  I want to add shopping cart features to my product using nopCommerce.  It seems like the nopCommerce DB is already configured for this type of integration.

Is it safe to assume that each object in the database is mapped to a store?  Is a store (storeId) at the top of the hierarchy?  I would like to be able to map stores to my existing customers accounts via an AccountId.
5 years ago
If I understand you question then

adam9367 wrote:
Is it safe to assume that each object in the database is mapped to a store?

There are no default mappings i.e. no entries in the storemapping table
The system works by either having no mapping i.e. the object is displayed on all stores
or limiting an object to a store i.e. the object only displays on the store to which it is mapped

adam9367 wrote:
I would like to be able to map stores to my existing customers accounts via an AccountId.

I think you could do this
If there is no accountId mapped i.e. default value - they can see all objects in all stores
If you mapped an accountId to a storeId then they only see the objects in only that store to which they are mapped
5 years ago
That's what I was hunting for.  Thank you!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.