You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the exception: PDOException: You cannot serialize or unserialize PDO instances when I tried to save a \DoctrineExtensions\NestedSet\NodeWrapper object in Doctrine Cache. To fix this bug I made the following changes in NodeWrapper class. Please, consider add this changes in next release.
/** * To avoid PDO exception, the property 'manager' cannot be serialized * If you need the manager after unserialize the object, you MUST call the attachManager() method in the current wrapper * @return array */function__sleep() {
return [
'node',
'parent',
'ancestors',
'descendants',
'children',
'level',
'outlineNumbers',
];
}
/** * Attach a {@see \DoctrineExtensions\NestedSet\Manager} to the current wrapper * This method is useful after wakeup a serialized object * @param Manager $manager */publicfunctionattachManager(Manager$manager) {
if (empty($this->manager)) {
$this->manager = $manager;
}
}
The text was updated successfully, but these errors were encountered:
I got the exception:
PDOException: You cannot serialize or unserialize PDO instances
when I tried to save a\DoctrineExtensions\NestedSet\NodeWrapper
object in Doctrine Cache. To fix this bug I made the following changes in NodeWrapper class. Please, consider add this changes in next release.The text was updated successfully, but these errors were encountered: