public static function hydrate(stdClass $file)
    {
        $hydrated = new FileEntity();

        if (isset($file->id)) {
            $hydrated->setId($file->id);
        }

        if (isset($file->loc)) {
            $hydrated->setLoc($file->loc);
        }

        if (isset($file->path)) {
            $hydrated->setPath($file->path);
        }

        if (isset($file->scanned)) {
            $hydrated->setScanned($file->scanned);
        }

        if (isset($file->code)) {
            $hydrated->setCode($file->code);
        }

        return $hydrated;
    }