Skip to content
Snippets Groups Projects
AdapterWSController.php 774 B
Newer Older
  • Learn to ignore specific revisions
  • Florian Azizian's avatar
    Florian Azizian committed
    <?php
    
    
    Florian Azizian's avatar
    Florian Azizian committed
    /**
    * Copyright Maarch since 2008 under licence GPLv3.
    * See LICENCE.txt file at the root folder for more details.
    * This file is part of Maarch software.
    *
    */
    
    /**
    * @briefAdapter WS Controller
    * @author dev@maarch.org
    */
    
    
    Florian Azizian's avatar
    Florian Azizian committed
    namespace ExportSeda\controllers;
    
    use MessageExchange\models\MessageExchangeModel;
    
    class AdapterWSController
    {
    
    Florian Azizian's avatar
    Florian Azizian committed
        public function send($messageObject, $messageId, $type)
    
            $res     = TransferController::transfer('maarchcourrier', $messageId, $type);
    
    Florian Azizian's avatar
    Florian Azizian committed
    
            if ($res['status'] == 1) {
    
                MessageExchangeModel::updateStatusMessage(['messageId' => $messageId, 'status' => 'E']);
    
    Florian Azizian's avatar
    Florian Azizian committed
                return $res;
            }
    
    
            MessageExchangeModel::updateStatusMessage(['messageId' => $messageId, 'status' => 'S']);