<?php

namespace DC\ThreadThumbnail\Cron;

class Thumbnail
{
    public static function fetchThumb()
    {
        $threads = \XF::finder('XF:Thread')
            ->where('DC_ThreadThumbnail_tempThumbUrl', '')
            ->fetch();

        foreach($threads AS $thread)
        {
            $thread->DC_ThreadThumbnail_tempThumbUrl = $thread->getThumbnailSmall();
            $thread->DC_ThreadThumbnail_tempImageUrl = $thread->getThumbnailFull();
            $thread->save();
        }
    } 
}