Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

vendor\bin\doctrine.bat orm:info

Uso o VScode porem quando uso o orm:info ele retorna o erro abaixo, podem me ajudar a encontrar o erro?

 !
 ! [CAUTION] You do not have any mapped Doctrine ORM entities according to the current configuration.
 !
 !           If you have entities or mapping files you should check your mapping configuration for errors.
 !

Segue a classe aluno:

<?php

namespace Projeto\Doctrim\Entity;


/**
 * @Entity
 */
class Aluno
{
    /**
     * @Id
     * @GeneratedValue
     * @Column(type="integer")
     */
    private $id;
    /**
     * @Column(type="string")
     */
    private $nome;

    public function getId(): int
    {
        return $this->id;
    }

    public function getNome(): string
    {
        return $this->nome;
    }

    public function setNome(string $nome): self
    {
        $this->nome = $nome;
        return $this;
    }
}
1 resposta
solução!

consegui resolver

no metodo getEntityManager da classe EntityManagerFactory tive que configurar o root para $rootDir = DIR . "/../../src/Entity";

Deveriam mudar o exemplo do Banco de dados do curso ja usando o MYSQL ou outro relacional.

<?php

namespace Projeto\Doctrim\Helper;



use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Setup;

class EntityManagerFactory
{

    public function getEntityManager() : EntityManagerInterface
    {
        $rootDir = __DIR__ . "/../../src/Entity";
        $config = Setup::createAnnotationMetadataConfiguration([$rootDir],true,null,null,false);

        $connection =[
            'driver' => 'pdo_mysql',
            'host'     => 'localhost',
            'port'     => '3306',
            'user'     => 'root',
            'password' => '123456',
            'dbname'   => 'banco',

        ];

        return EntityManager::create($connection, $config);

    }

}

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software