public static function hydrate(stdClass $queue)
    {
        $hydrated = new QueueEntity();

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

        if (isset($queue->started_at)) {
            $hydrated->setStartedAt(new DateTime($queue->started_at));
        }

        if (isset($queue->finished_at)) {
            $hydrated->setFinishedAt(new DateTime($queue->finished_at));
        }

        return $hydrated;
    }