Skip to content

Conversation

@Jurj-Bogdan
Copy link
Member

Closes #122.

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.
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

remove new line

Copy link
Member Author

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/
Copy link
Member

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:
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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]>
@arhimede arhimede merged commit 75c0523 into main Aug 21, 2025
10 checks passed
@alexmerlin alexmerlin deleted the dot-maker-book-tutorial branch October 1, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Book module tutorial using dotkernel/dot-maker

4 participants