Guest User

Untitled

a guest
Nov 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public function __construct(UserRepository $users)
  2. {
  3. $this->users = $users;
  4. }
  5.  
  6.  
  7. public function execute(Passenger $user, int $cityId, string $companyName = '')
  8. {
  9. $city = $this->users->getCityReferenceById($cityId);
  10. $user->addCity($city);
  11. ....
  12. }
  13.  
  14. public function getCityReferenceById(int $cityId): City
  15. {
  16. return $this->em->getReference(City::class, $cityId);
  17. }
Add Comment
Please, Sign In to add comment