public static function fromCache($file, $str, $localCache) { self::$fromCache = true; $self = new self($file); $self->path = $file; $self->localCache = $localCache; $self->annotations = new Annotations(); foreach (unserialize($str) as $object) { $self->addObject($object); } self::$fromCache = false; return $self; }