added book module tutorial using dot-maker#123
Merged
Conversation
Signed-off-by: Jurj-Bogdan <bogdanjurj11@gmail.com>
Signed-off-by: Jurj-Bogdan <bogdanjurj11@gmail.com>
Signed-off-by: Jurj-Bogdan <bogdanjurj11@gmail.com>
Signed-off-by: Jurj-Bogdan <bogdanjurj11@gmail.com>
bidi47
reviewed
Aug 21, 2025
| ## 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. |
Member
There was a problem hiding this comment.
remove new line - a phrase should be on a single line
bidi47
reviewed
Aug 21, 2025
| ``` | ||
|
|
||
| * `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. |
Member
Author
There was a problem hiding this comment.
that will probably cause linting issues (if you're referring to line 93?)
bidi47
reviewed
Aug 21, 2025
| ``` | ||
|
|
||
| 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/ |
Member
There was a problem hiding this comment.
period (.) instead of slash (/)?
bidi47
reviewed
Aug 21, 2025
|
|
||
| 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: |
Member
There was a problem hiding this comment.
move 'However...' to new line - only one phrase per line
bidi47
reviewed
Aug 21, 2025
|
|
||
| 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 |
bidi47
reviewed
Aug 21, 2025
|
|
||
| ## 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. |
Member
There was a problem hiding this comment.
replace 'As all changes are done' with 'All changes are done'
bidi47
reviewed
Aug 21, 2025
| 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. |
Member
There was a problem hiding this comment.
might help visually to have the highlight for the location
src/Core/src/App/src/Migration
Signed-off-by: Jurj-Bogdan <bogdanjurj11@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122.