@@ 67-76 (lines=10) @@ | ||
64 | * @return PasswordInterface |
|
65 | * @throws NoSuchEntityException |
|
66 | */ |
|
67 | public function getByCustomerId(int $customerId): PasswordInterface |
|
68 | { |
|
69 | /** @var Password $password */ |
|
70 | $password = $this->passwordFactory->create(); |
|
71 | $this->passwordResource->load($password, $customerId, Password::CUSTOMER_ID); |
|
72 | if (!$password->getId()) { |
|
73 | throw new NoSuchEntityException(); |
|
74 | } |
|
75 | return $password->getDataModel(); |
|
76 | } |
|
77 | ||
78 | /** |
|
79 | * @param PasswordInterface $password |
|
@@ 103-113 (lines=11) @@ | ||
100 | * @return void |
|
101 | * @throws Exception |
|
102 | */ |
|
103 | public function delete(PasswordInterface $password): void |
|
104 | { |
|
105 | if (!$password->getId()) { |
|
106 | throw new NoSuchEntityException(); |
|
107 | } |
|
108 | ||
109 | /** @var Password $model */ |
|
110 | $model = $this->passwordFactory->create(); |
|
111 | $this->passwordResource->load($model, $password->getId()); |
|
112 | $this->passwordResource->delete($model); |
|
113 | } |
|
114 | ||
115 | /** |
|
116 | * @param string $dateTime |