Olá Alura,
estou com um problema na hora de fazer um "list". Aqui esta o link do github:
git@github.com:tiagobrandao03/2612-doctrine.git
Abaixo está o resultado do erro.
/** @var $student */
$result = $studentRepository->findOneBy([
'name' =>'Ana Maria'
]);
var_dump($result);
resultado
C:\xampp\htdocs\2612-doctrine>php bin/list-students.php
ID: 1
Nome:
ID: 2
Nome:
ID: 3
Nome:
ID: 4
Nome:
ID: 5
Nome:
ID: 6
Nome:
ID: 7
Nome:
ID: 8
Nome:
ID: 9
Nome:
ID: 10
Nome:
PHP Fatal error: Uncaught Doctrine\ORM\Persisters\Exception\UnrecognizedField: Unrecognized field: Alura\Doctrine\Entity\Student::$name in C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Exception\UnrecognizedField.php:22
Stack trace:
#0 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(1762): Doctrine\ORM\Persisters\Exception\UnrecognizedField::byFullyQualifiedName('Alura\\Doctrine\\...', 'name')
#1 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(1633): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getSelectConditionStatementColumnSQL('name', NULL)
#2 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(1783): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getSelectConditionStatementSQL('name', 'Ana Maria', NULL)
#3 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(1094): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getSelectConditionSQL(Array, NULL)
#4 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(748): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getSelectSQL(Array, NULL, NULL, 1, NULL, NULL)
#5 C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\EntityRepository.php(241): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL, NULL, Array, NULL, 1, NULL)
#6 C:\xampp\htdocs\2612-doctrine\bin\list-students.php(19): Doctrine\ORM\EntityRepository->findOneBy(Array)
#7 {main}
thrown in C:\xampp\htdocs\2612-doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Exception\UnrecognizedField.php on line 22