|
|
@@ -24,6 +24,31 @@ class SharedProsperityUserRepository extends BaseRepository
|
|
24
|
24
|
}
|
|
25
|
25
|
|
|
26
|
26
|
/**
|
|
|
27
|
+ * @param int $id
|
|
|
28
|
+ * @return SharedProsperityUserEntity
|
|
|
29
|
+ */
|
|
|
30
|
+ public function getSharedProsperityUserEntityById(int $id): SharedProsperityUserEntity
|
|
|
31
|
+ {
|
|
|
32
|
+ $entityList = $this->getSharedProsperityUserEntityListByIdList([$id]);
|
|
|
33
|
+ $entity = array_shift($entityList);
|
|
|
34
|
+ if ($entity instanceof SharedProsperityUserEntity) {
|
|
|
35
|
+ return $entity;
|
|
|
36
|
+ } else {
|
|
|
37
|
+ /** @var SharedProsperityUserEntity */
|
|
|
38
|
+ return SharedProsperityUserEntity::newInstance();
|
|
|
39
|
+ }
|
|
|
40
|
+ }
|
|
|
41
|
+
|
|
|
42
|
+ /**
|
|
|
43
|
+ * @param array $idList
|
|
|
44
|
+ * @return SharedProsperityUserEntity[]
|
|
|
45
|
+ */
|
|
|
46
|
+ public function getSharedProsperityUserEntityListByIdList(array $idList): array
|
|
|
47
|
+ {
|
|
|
48
|
+ return $this->dao->getSharedProsperityUserEntityListByIdList($idList);
|
|
|
49
|
+ }
|
|
|
50
|
+
|
|
|
51
|
+ /**
|
|
27
|
52
|
* @param int $userId
|
|
28
|
53
|
* @return SharedProsperityUserEntity
|
|
29
|
54
|
*/
|
|
|
@@ -111,7 +136,7 @@ class SharedProsperityUserRepository extends BaseRepository
|
|
111
|
136
|
}
|
|
112
|
137
|
$result = $this->update($sharedProsperityUserEntity->getId(), $sharedProsperityUserEntity->toUnderlineArray());
|
|
113
|
138
|
if ($result > 0) {
|
|
114
|
|
- return $this->getSharedProsperityUserEntityByUserId($sharedProsperityUserEntity->getUserId());
|
|
|
139
|
+ return $this->getSharedProsperityUserEntityById($sharedProsperityUserEntity->getId());
|
|
115
|
140
|
}
|
|
116
|
141
|
return SharedProsperityUserEntity::newInstance();
|
|
117
|
142
|
}
|