Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15678 | Rev 15680 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

<?php

declare(strict_types=1);

namespace LeadersLinked\Controller;

use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
use Laminas\View\Model\JsonModel;

// Create an action controller.
class DiscoveryContactProgressController extends AbstractActionController
{
    // Define an action "world".
    public function indexAction()
    {
        $currentUserPlugin = $this->plugin('currentUserPlugin');
        $currentUser = $currentUserPlugin->getUser();
        $currentCompany = $currentUserPlugin->getCompany();

        $request = $this->getRequest();
        if ($request->isGet()) {
            $headers  = $request->getHeaders();
            $isJson = false;

            $prioritized = $accept->getPrioritized();

            foreach ($prioritized as $key => $value) {
                $raw = trim($value->getRaw());

                if (!$isJson) {
                    $isJson = strpos($raw, 'json');
                }
            }


            return new JsonModel([
                'success' => true,
                'message' => $headers
            ]);
        }
        return new JsonModel([
            'success' => true,
            'message' => $currentUser
        ]);
    }
}