Skip to content

Commit 4f69eb6

Browse files
authored
Merge pull request #6134 from tangix/update-model-docs
Updated to use ::class in $returnType example
2 parents 3be408f + 6be86cf commit 4f69eb6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

user_guide_src/source/models/model.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ The Model's CRUD methods will take a step of work away from you and automaticall
116116
the resulting data, instead of the Result object. This setting allows you to define
117117
the type of data that is returned. Valid values are '**array**' (the default), '**object**', or the **fully
118118
qualified name of a class** that can be used with the Result object's ``getCustomResultObject()``
119-
method.
119+
method. Using the special ``::class`` constant of the class will allow most IDEs to
120+
auto-complete the name and allow functions like refactoring to better understand your code.
120121

121122
$useSoftDeletes
122123
---------------

user_guide_src/source/models/model/021.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class JobModel extends Model
88
{
99
protected $table = 'jobs';
10-
protected $returnType = '\App\Entities\Job';
10+
protected $returnType = \App\Entities\Job::class;
1111
protected $allowedFields = [
1212
'name', 'description',
1313
];

0 commit comments

Comments
 (0)