I use some php library, and generate element of class
$elnew = new LibClass(); I want to save this variable to cache. If I make like this
$elem = $cache->getItem($ig_name); if (!$elem->isHit()) { $elem->set($elnew); $cache->save($ig); } $elem->isHit() is always false. I checked how cache works with string - all is ok. Also I'm not able to serialyze/unserialyze this object because it says
Serialization of 'Closure' is not allowed
and no way to modify LibClass
How can I save $elnew to cache? Any variants for with symfony components? Or maybe other libs can help me?