What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello, for the merchant relationship feature, there is a `spy_merchant_relationship` table which rep
Hello,
for the merchant relationship feature, there is a spy_merchant_relationship
table which represents the m:n mapping between the spy_merchant
and spy_company_business_unit
using the the ids of both as foreign key in spy_merchant_relationship
…
However, there is another table spy_merchant_relationship_to_company_business_unit
which represents another m:n relation between spy_company_business_unit
and spy_merchant_relationship
…
Do i miss something or isn’t the second table some kind of redundant information since its already represented by the first one?
I just wonder why my relation was not created but it seems my facade call didn’t consider this table.
Best
Comments
-
spy_merchant_relationship_to_company_business_unit
is for assigned business units, they can be multiple - these BU will be affected by the relationship config0 -
spy_merchant_relationship.fk_company_business_unit
represents which business unit is owner of this merchant_relationship
0 -
So retrieving the merchant relationship via the company_user transfer means, that it just filled when the company_business_unit is the owner of the merchant relationship?
0 -
i mean, i created a relationship via the merchant relationship facade … but then i fetched the company user and the hydrated company unit and i expected the merchant relation to be the one that i created right now … but it seems that this is not true. instead it might be the ownership as already mentioned
0 -
Is the “ownership” of the relation necessary? I don’t think so since the creation process in the facade didn’t throw any error …. but it also did not create an entry in spy_merchant_relationship_to_company_business_unit
0 -
<column name="fk_company_business_unit" required="true" type="INTEGER"/>
it is requried for merchant relationship entity.
$merchantRelationTransfer ->requireFkMerchant() ->requireFkCompanyBusinessUnit();
To save business units to merchant relationship via
MerchantRelationshipFacade::create
add
$merchantRelationTransfer->setAssigneeCompanyBusinessUnits((new CompanyBusinessUnitCollectionTransfer())->setCompanyBusinessUnits($companyBusinessUnitTransfers));
0 -
CompanyBusinessUnitTransfer->idCompanyBusinessUnit
is only required in this case
0 -
Thanks a lot … 🙂 last question i didn’t ask yet: what is this ownership needed for? When using the merchant related price between merchant and a business unit, what relation i should look for? The “ownership” between the business_unit/merchant_relationship (represented by spy_merchant_relationship_to_company_business_unit) or the collection of spy_merchant_Relationship? I am a bit confused, sorry^^
0 -
for prices only relations via
spy_merchant_relationship_to_company_business_unit
matters0 -
$merchantRelationshipTransfer->getOwnerCompanyBusinessUnit()
Could be used for some business logic, in Spryker modules it's used to display related to merchant relationship Company and combine it with Business Unit name, e.g.
Company X (Sales Departement)
0 -
also you cannot assign merchant relationship to another company business units if this one owned by business unit from different company
0 -
I think that is all 🙂
0 -
-
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random