public function fromCache(array $cache) { $annotations = new self(); foreach ($cache as $object => $ann) { $object = unserialize($object); $ann = array_map(function ($a) { return Annotation::fromCache($a); }, $ann); $obj = new self($ann); if ($object) { $obj->setObject($object); } $annotations->merge($obj); } return $annotations; }