コード例 #1
0
ファイル: CartService.php プロジェクト: inklabs/kommerce-core
 /**
  * @param UuidInterface $cartId
  * @param UuidInterface $userId
  * @throws EntityNotFoundException
  */
 public function setUserById(UuidInterface $cartId, UuidInterface $userId)
 {
     $user = $this->userRepository->findOneById($userId);
     $cart = $this->cartRepository->findOneById($cartId);
     $cart->setUser($user);
     $this->cartRepository->update($cart);
 }
コード例 #2
0
ファイル: UserService.php プロジェクト: inklabs/kommerce-core
 public function changePassword(UuidInterface $userId, $password)
 {
     $user = $this->userRepository->findOneById($userId);
     $userPasswordValidator = new UserPasswordValidator();
     $userPasswordValidator->assertPasswordValid($user, $password);
     $user->setPassword($password);
     $this->update($user);
 }
コード例 #3
0
 public function testFindOneByIdThrowsException()
 {
     $this->setExpectedException(EntityNotFoundException::class, 'User not found');
     $this->userRepository->findOneById($this->dummyData->getId());
 }