<?php

namespace App\Controllers\Seller\Warehouse;

use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
use \App\Controllers\Container;
use App\Models\Entity\Seller\UserSeller;

class CadastroNovoSeller extends Container {

    public function up(Request $request, Response $response, $args) {

        // env.php define variaveis
        $token = getenv('token');
        $appKey = getenv('appkey');

        $route = $request->getAttribute('route');
        $dock = $route->getArgument('dock');
        $newseller = $route->getArgument('newseller');

        $entityManager = $this->container->get('em');


        $userSellerNew = $entityManager->getRepository('App\Models\Entity\Seller\UserSeller');


        $stmt = $entityManager->getConnection()->prepare("INSERT INTO userseller(nameUser)VALUES('" . $newseller . "')");
        $stmt->execute();

        return $response->withJson($responseCurl, 200)->withHeader('Content-type', 'application/json');
    }

}
