Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct(UserRepository $users)
- {
- $this->users = $users;
- }
- public function execute(Passenger $user, int $cityId, string $companyName = '')
- {
- $city = $this->users->getCityReferenceById($cityId);
- $user->addCity($city);
- ....
- }
- public function getCityReferenceById(int $cityId): City
- {
- return $this->em->getReference(City::class, $cityId);
- }
Add Comment
Please, Sign In to add comment