@@ -112,26 +112,17 @@ use {repositoryInterfaceNamespace}\{repositoryInterface};
112112class UserService {
113113
114114 /**
115- * interface name registered in container
116- * @var string
117- */
118- protected $interfaceName = '{repositoryInterface}';
119- protected $mainRepository;
115+ * don't change $this->mainRepository variable name
116+ * because used in service class
117+ */
118+ protected $mainRepository;
120119
121- public function __construct({repositoryInterface} $mainRepository)
122- {
123- $this->initialiseRepository();
124- $this->mainRepository = $mainRepository;
125- }
126-
127- // Define your custom methods :)
120+ public function __construct({repositoryInterface} $mainRepository)
121+ {
122+ $this->mainRepository = $mainRepository;
123+ }
128124
129- public function __construct({repositoryInterface} $mainRepository)
130- {
131- $this->mainRepository = $mainRepository;
132- }
133-
134- // Define your custom methods :)
125+ // Define your custom methods :)
135126}
136127
137128```
@@ -237,25 +228,18 @@ use {repositoryInterfaceNamespace}\{repositoryInterface};
237228class UserService {
238229 use ResultService;
239230
240- /**
241- * interface name registered in container
242- * @var string
243- */
244- protected $interfaceName = '{repositoryInterface}';
245- protected $mainRepository;
231+ /**
232+ * don't change $this->mainRepository variable name
233+ * because used in service class
234+ */
235+ protected $mainRepository;
246236
247- public function __construct({repositoryInterface} $mainRepository)
248- {
249- $this->initialiseRepository();
250- $this->mainRepository = $mainRepository;
251- }
237+ public function __construct({repositoryInterface} $mainRepository)
238+ {
239+ $this->mainRepository = $mainRepository;
240+ }
252241
253242 // Define your custom methods :)
254-
255- public function __construct({repositoryInterface} $mainRepository)
256- {
257- $this->mainRepository = $mainRepository;
258- }
259243
260244 public function all () {
261245 try {
0 commit comments