Skip to content

Commit

Permalink
docs: break long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 26, 2024
1 parent 03c3ca3 commit 0539297
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions user_guide_src/source/models/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ Create the model first at **app/Models/UserModel.php** so that we can interact w

The model uses the ``users`` table in the database for all of its activities.

We've set the ``$allowedFields`` property
to include all of the fields that we want outside classes to change. The ``id``, ``created_at``, and ``updated_at`` fields
are handled automatically by the class or the database, so we don't want to change those.

Finally, we've set our Entity
class as the ``$returnType``. This ensures that all methods on the model that return rows from the database will return
instances of our User Entity class instead of an object or array like normal.
We've set the ``$allowedFields`` property to include all of the fields that we
want outside classes to change. The ``id``, ``created_at``, and ``updated_at``
fields are handled automatically by the class or the database, so we don't want
to change those.

Finally, we've set our Entity class as the ``$returnType``. This ensures that all
methods on the model that return rows from the database will return instances of
our User Entity class instead of an object or array like normal.

Working with the Entity Class
=============================
Expand Down

0 comments on commit 0539297

Please sign in to comment.