<?php

namespace Mtc\Plugins\MtcUnioIntegration\Classes;

use Mtc\Modules\MtcUnio\Classes\UnioApi;

class UnioQueue
{
    //const QUEUE_MESSAGES_FROM_UNIO = 'messages_from_unio';
    //const QUEUE_MESSAGES_TO_UNIO = 'messages_to_unio';

    //private $type = '';

    //private static $instance = null;

    //private function __construct($type)
    //{
    //    $this->type = $type;
    //}


    //public static function init($type)
    //{
    //    if (! self::$instance) {
    //        self::$instance = new self($type);
    //    }

    //    return self::$instance;
    //}


    //public function enqueue($entity_type, $entity_id)
    //{
    //    switch ($this->type) {
    //        case self::QUEUE_MESSAGES_FROM_UNIO:
    //            $msg = new QueueMessageFromUnio();
    //            break;

    //        case self::QUEUE_MESSAGES_TO_UNIO:
    //            $msg = new QueueMessageToUnio();
    //            break;
    //    }

    //    $msg->entity_type = $entity_type;
    //    $msg->entity_id = $entity_id;
    //    $msg->save();
    //}


    //public function dequeue()
    //{
    //    switch ($this->type) {
    //        case self::QUEUE_MESSAGES_FROM_UNIO:
    //            $class_name = QueueMessageFromUnio::class;
    //            break;

    //        case self::QUEUE_MESSAGES_TO_UNIO:
    //            $class_name = QueueMessageToUnio::class;
    //            break;
    //    }

    //    return $class_name::query()
    //        //->whereNull('processed_at')
    //        ->first()
    //    ;
    //}

}
