You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Have Symfony auto-wire the repository via your constructor
298
+
public function __construct(MovieRepository $movieRepository)
299
+
{
300
+
$this->movieRepository = $movieRepository;
301
+
}
302
+
303
+
public function findMovie(string $id): AbstractModel
304
+
{
305
+
// Use the auto-wired repository in any of your methods
306
+
return $this->movieRepository->load($id);
307
+
}
308
+
}
272
309
```
273
310
274
311
An overview of all the repositories can be found in the services configuration [repositories.xml](https://github.com/php-tmdb/symfony/blob/master/Resources/config/repositories.xml).
0 commit comments