Ao inserir no meu projeto o doctrine, quando tento fazer uma busca qualquer no banco ele retorna isso
Error: Your proxy directory "/var/folders/86/0qw6jrm91cz_lhrgqlv0tw040000gn/T" must be writable
Porem se eu faço um arquivo fora da minha arquitetura ele retorna nomal não sei oque pode ser!!!!
Estou tentando fazer isso:
<?php
use app\Infrastructure\DataProvider\API\Collaborator\ApiFetchCollaboratorByRoleRepository;
use app\Infrastructure\DataProvider\ORM\Doctrine\EntityManagerCreator;
use app\Infrastructure\Http\Request;
use app\Infrastructure\Http\Response;
use app\Infrastructure\Router\StyleCompanyRouter;
use app\Infrastructure\Router\ValidateCompanyRouter;
use app\Presentation\Controller\Client\Home\HomeClientController;
use app\Application\UseCase\Collaborator\CollaboratorByRole\CollaboratorByRole;
$obRouter->get('/homeclient/{tokenCompany}',[
function(Request $request, string $tokenCompany) {
try {
$obCompany = (new ValidateCompanyRouter())->checkCompany($request, $tokenCompany);
$obStyle = (new StyleCompanyRouter())->getStyleByCompany($request,$obCompany);
$entityManager = EntityManagerCreator::createEntityManager();
$repo = $entityManager->getRepository(\app\Domain\Entities\Service::class);
var_dump($repo->find(4));
return new Response(200, (new HomeClientController())->getViewHome($request,$obCompany,$obStyle));
} catch (\Exception $e) {
echo $e->getMessage();
//$request->getRouter()->redirect('/allcompany?error=' . urlencode($e->getMessage()));
}
}
]);
Alguem poderia me ajuda
<?php
namespace app\Infrastructure\DataProvider\ORM\Doctrine;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\ORMSetup;
class EntityManagerCreator
{
public static function createEntityManager(): EntityManager
{
// Caminho ajustado para apontar diretamente para o diretório de entidades
$entityPaths = [__DIR__.'/../../../../Domain/Entities/'];
// Criação da configuração do Doctrine ORM
$config = ORMSetup::createAttributeMetadataConfiguration(
paths: $entityPaths,
isDevMode: true,
);
// Configuração da conexão com o banco de dados
$connection = DriverManager::getConnection([
'driver' => 'pdo_mysql',
'host' => '',
'dbname' => '#',
'port' => '',
'user' => '',
'password' => '',
], $config);
return EntityManager::create($connection, $config);
}
}
RETIREI AS CONEXOES POREM ELAS ESTAO CORRETAS OS MAPPING ESTAO CORRETOS
macintosh@MBP-de-Pereira mycorte % php vendor/bin/doctrine orm:validate-schema
[Warning] The use of this script is discouraged. See https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/tools.html#doctrine-console for instructions on bootstrapping the console runner.
Mapping
-------
[OK] The mapping files are correct.