Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Fix set and get view model method code #8494

Closed
wants to merge 1 commit into from
Closed

Conversation

pawan
Copy link
Member

@pawan pawan commented Jan 10, 2021

Purpose of this pull request

This pull request (PR) is fix for issue #8493

Affected DevDocs pages

@ghost
Copy link

ghost commented Jan 11, 2021

Hi @pawan, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@pawan
Copy link
Member Author

pawan commented Jan 11, 2021

Adobe CLA sign

@hostep
Copy link
Contributor

hostep commented Jan 11, 2021

@pawan, thanks, but this duplicates #8459 I believe, maybe you can collaborate on that ticket to get everything explained better?

@@ -139,3 +139,5 @@ $postArray = $viewModel->getPostData(
['product' => $_item->getEntityId()]
);
```
{:.bs-callout-info}
If you use `argument name="view_model"` you can access it using `$viewModel = $block->getViewModel();` Or You can use `argument name="viewModel"` and can access `$viewModel = $block->getData('viewModel');`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF this is true then the to changes above are mutually exclusive - only one of them should have been changed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, It depends on implementation! either we can use Getter/Setter OR we can get Data of argument!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dobooth
Copy link
Contributor

dobooth commented Jan 13, 2021

Thanks for this, @pawan. Since we have 3 PRs around this fix, feels proper to take the first one. Thanks for contributing, though. Nice to see so many eyes on the docs. We will take #8459 for the fix.

@dobooth dobooth closed this Jan 13, 2021
@ghost
Copy link

ghost commented Jan 13, 2021

Hi @pawan, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@pawan
Copy link
Member Author

pawan commented Jan 13, 2021

@BarnyShergold OK, why it is showing 2 closed pull request at https://opensource.magento.com/profile/pawan/contribution_statistic

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants