Last active
September 17, 2020 21:26
-
-
Save mikedfunk/e81a18b8e06d089d76cd63bf81d6b8da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace SaatchiArt\BentoBoxDDD\Services\UserActions; | |
use SaatchiArt\BentoBoxDDD\Services\UserActions\SecondaryAdapters\Repositories\UserRepositoryInterface as UserRepository; | |
final class UserService | |
{ | |
/** @var UserRepository */ | |
private $userRepository; | |
/** @var ArtworkService */ | |
private $artworkService; | |
public function __construct( | |
UserRepository $userRepository, | |
ArtworkService $artworkService | |
) { | |
$this->userRepository = $userRepository; | |
$this->artworkService = $artworkService; | |
} | |
public function goOnVacation(int $userId): void | |
{ | |
$user = $this->userRepository->findByUserId($userId); | |
$user->goOnVacation(); | |
$this->userRepository->storeUser($user); | |
$this->artworkService->makeNotForSaleByUserId($userId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment