Symfony를 사용하여 내 엔티티를 저장하는 데 Cache Manager (FilesystemCache)을 사용하고 싶습니다.Symfony 캐시에 부분 정보 저장
$find = $this->entityManager->getRepository(User::class)
->getSingleResult([
'whereId' => $id,
]);
dump($find); // First dump()
$this->cacheManager->set('user-1', $find);
dump($this->cacheManager->get('user-1')); // Second dump()
먼저 덤프 : 나는 이런 짓을
User {#457 ▼
-id: 1
-username: "[email protected]"
-email: "[email protected]"
-plainPassword: null
-password: "$2y$13$sFSRu2lyDmrfFZP24vkeQOiaYJ5E2eo/kLlaIITgwTrwZunEBcO1q"
-onlineAt: DateTime {#432 ▶}
-changePasswordAt: null
-roles: array:3 [▶]
-registerToken: null
-versions: PersistentCollection {#558 ▶}
-deletedAt: null
-deletedBy: null
}
둘째 덤프 :
User {#188 ▼
-id: 1
-username: "[email protected]"
-email: null
-plainPassword: null
-password: "$2y$13$sFSRu2lyDmrfFZP24vkeQOiaYJ5E2eo/kLlaIITgwTrwZunEBcO1q"
-onlineAt: null
-changePasswordAt: null
-roles: []
-registerToken: null
-versions: null
-deletedAt: null
-deletedBy: null
}
왜 내 두 번째 덤프()가 모든 정보를 가지고하지 않는 이유는 무엇입니까?