<?php
use Orm\Doctrine\Entity\Aluno;
use Orm\Doctrine\Helper\EntityManagerFactory;
require_once __DIR__ . '/../vendor/autoload.php';
$entityManagerFactory = new EntityManagerFactory();
$entityManager = $entityManagerFactory->getEntityManager();
$alunoRepository = $entityManager->getRepository(Aluno::class);
$id = $argv[1];
$novoNome = $argv[2];
$aluno = $alunoRepository->find($id);
$aluno->setNome($novoNome);
$entityManager->flush();
estou fazendo esse trecho de código, mas apresenta o seguinte erro:
PHP Warning: Undefined array key 1 in /home/desenvolvimento/Documentos/ORM/commands/atualizarNomeAluno.php on line 12 PHP Warning: Undefined array key 2 in /home/desenvolvimento/Documentos/ORM/commands/atualizarNomeAluno.php on line 13 PHP Fatal error: Uncaught Doctrine\ORM\Exception\MissingIdentifierField: The identifier id is missing for a query of Orm\Doctrine\Entity\Aluno in /home/desenvolvimento/Documentos/ORM/vendor/doctrine/orm/lib/Doctrine/ORM/Exception/MissingIdentifierField.php:13 Stack trace:
#0 /home/desenvolvimento/Documentos/ORM/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(457): Doctrine\ORM\Exception\MissingIdentifierField::fromFieldAndClass()
#1 /home/desenvolvimento/Documentos/ORM/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(199): Doctrine\ORM\EntityManager->find()
#2 /home/desenvolvimento/Documentos/ORM/commands/atualizarNomeAluno.php(15): Doctrine\ORM\EntityRepository->find()
#3 {main} thrown in /home/desenvolvimento/Documentos/ORM/vendor/doctrine/orm/lib/Doctrine/ORM/Exception/MissingIdentifierField.php on line 13