With Symfony, I want to use Cache Manager (FilesystemCache) for save my entities. I did this :
$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()
First dump :
User {#457 ▼
-id: 1
-username: "contact@site.com"
-email: "contact@site.com"
-plainPassword: null
-password: "$2y$13$sFSRu2lyDmrfFZP24vkeQOiaYJ5E2eo/kLlaIITgwTrwZunEBcO1q"
-onlineAt: DateTime {#432 ▶}
-changePasswordAt: null
-roles: array:3 [▶]
-registerToken: null
-versions: PersistentCollection {#558 ▶}
-deletedAt: null
-deletedBy: null
}
Second dump :
User {#188 ▼
-id: 1
-username: "contact@site.com"
-email: null
-plainPassword: null
-password: "$2y$13$sFSRu2lyDmrfFZP24vkeQOiaYJ5E2eo/kLlaIITgwTrwZunEBcO1q"
-onlineAt: null
-changePasswordAt: null
-roles: []
-registerToken: null
-versions: null
-deletedAt: null
-deletedBy: null
}
Why my second dump() does not have all the informations ?