-
Notifications
You must be signed in to change notification settings - Fork 2
added book module tutorial using dot-maker #123
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
Conversation
Signed-off-by: Jurj-Bogdan <[email protected]>
Signed-off-by: Jurj-Bogdan <[email protected]>
Signed-off-by: Jurj-Bogdan <[email protected]>
Signed-off-by: Jurj-Bogdan <[email protected]>
| ## Folder and files structure | ||
|
|
||
| The below files structure is what we will have at the end of this tutorial and is just an example, | ||
| you can have multiple components such as event listeners, wrappers, etc. |
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.
remove new line - a phrase should be on a single line
| ``` | ||
|
|
||
| * `dot-maker` will by default prompt you to generate the migrations for the new entity, but for the purpose of this tutorial | ||
| we will run this after updating the generated entity. |
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.
remove new line
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.
that will probably cause linting issues (if you're referring to line 93?)
| ``` | ||
|
|
||
| The `BookService` class will require minor modifications for the `getBooks()` and `saveBook()` methods, to add the custom properties added in the previous step. | ||
| The class should look like the following after updating the methods/ |
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.
period (.) instead of slash (/)?
|
|
||
| When creating or updating a book, we will need some validators, so we will create input filters that will be used to validate the data received in the request. | ||
|
|
||
| By creating a `module` with `dot-maker`, separate inputs will not be created. However, you can still generate them as using these steps: |
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.
move 'However...' to new line - only one phrase per line
|
|
||
| We create separate `Input` files to demonstrate their reusability and obtain a clean `CreateBookInputFilter` but you could have all the inputs created directly in the `CreateBookInputFilter` like this: | ||
|
|
||
| > Note that `dot-maker` will not generate inputs in the constructor, so the following are to be added by hand **if** going for this approach |
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.
add a period (.) at the end
|
|
||
| ## Migrations | ||
|
|
||
| As all changes are done, so at this point the migration file can be generated to create the associated table for the `Book` entity. |
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.
replace 'As all changes are done' with 'All changes are done'
| php ./vendor/bin/doctrine-migrations diff | ||
| ``` | ||
|
|
||
| This will check for differences between your entities and database structure and create migration files if necessary, in src/Core/src/App/src/Migration. |
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.
might help visually to have the highlight for the location
src/Core/src/App/src/Migration
Signed-off-by: Jurj-Bogdan <[email protected]>
Closes #122.