File tree Expand file tree Collapse file tree
user_guide_src/source/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,9 +60,13 @@ Create the model first at **app/Models/UserModel.php** so that we can interact w
6060
6161.. literalinclude :: entities/002.php
6262
63- The model uses the ``users `` table in the database for all of its activities. We've set the ``$allowedFields `` property
63+ The model uses the ``users `` table in the database for all of its activities.
64+
65+ We've set the ``$allowedFields `` property
6466to include all of the fields that we want outside classes to change. The ``id ``, ``created_at ``, and ``updated_at `` fields
65- are handled automatically by the class or the database, so we don't want to change those. Finally, we've set our Entity
67+ are handled automatically by the class or the database, so we don't want to change those.
68+
69+ Finally, we've set our Entity
6670class as the ``$returnType ``. This ensures that all methods on the model that return rows from the database will return
6771instances of our User Entity class instead of an object or array like normal.
6872
You can’t perform that action at this time.
0 commit comments