-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy demoextendsymfonyform1 into demoextendsymfonyform3 #33
Conversation
This modules demonstrates | ||
- how to add this field, manage its content and its | ||
properties using modern hooks in Symfony pages | ||
- how to use custom [CQRS](https://devdocs.prestashop.com/1.7/development/architecture/domain/cqrs/) Commands and Queries to separate your domain from your application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- how to use custom [CQRS](https://devdocs.prestashop.com/1.7/development/architecture/domain/cqrs/) Commands and Queries to separate your domain from your application | |
- how to use custom [CQRS](https://devdocs.prestashop.com/1.7/development/architecture/domain/cqrs/) Commands and Queries to separate your domain from your application * |
- `composer install` - to download dependencies into vendor folder | ||
4. Install module from Back Office | ||
|
||
*Because the name of the directory and the name of the main module file must match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Because the name of the directory and the name of the main module file must match. | |
**Because the name of the directory and the name of the main module file must match.** |
|
||
parent::__construct(); | ||
|
||
$this->displayName = $this->getTranslator()->trans( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->displayName = $this->getTranslator()->trans( | |
$this->displayName = $this->trans( |
no need to get translator here, there's shorter trans
method in Module
); | ||
} | ||
|
||
throw new \PrestaShop\PrestaShop\Core\Module\Exception\ModuleErrorException($message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not importing it?
* | ||
* @return RedirectResponse | ||
*/ | ||
public function toggleIsAllowedForReviewAction($customerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function toggleIsAllowedForReviewAction($customerId) | |
public function toggleIsAllowedForReviewAction(int $customerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feedback
Hi @kpodemski as this PR is a simple copy can I keep the improvements for a later PR ? 😊 If it's a 100% identical copy, the great thing is that we are sure "it works as before" whereas if we introduce modifications, we now need to re-validate it entirely. |
/** | ||
* Class DemoExtendSymfonyForm1 demonstrates the usage of CQRS pattern and hooks. | ||
*/ | ||
class DemoExtendSymfonyForm3 extends Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as here #35 (comment)
I think it's a good thing to split into two modules to make it less confusing, but we really need to improve the naming of these two module Or it will remain confusing and they won't meet the expected objective
Suggested names for this one:
DemoExtendSymfonyPageWithCQRS
DemoExtendWithCQRS
DemoCQRSPattern
DemoCQRSForExtension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jolelievre I'll perform the renaming with the improvements suggested by @kpodemski in a 2nd PR to keep it scoped 😉 and I created an issue for global renaming #40
No problem @matks 👍 |
Thank you for review 😉 |
Some community developers think that the two must be together although actually you can choose to use CQRS or not to add new field to a Symfony form.
To fix this I will split this module into 2 demo modules. This PR creates the new module.