I do have an error and I don't know how to fix it.
$query = $entityManager->createQuery("UPDATE AppBundle:ChangeAPI SET `key`='asd123' WHERE `id` = 1");
$query->execute();
My AppBundle:ChangeAPI
/**
* @ORM\Entity
* @ORM\Table(name="api")
*/
class ChangeAPI
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* The date on which the shipment has been created
*
* @ORM\Column(type="string", name="key")
*/
protected $key;
/** Creates a new standard ride */
function __construct()
{
}
}
And this is my error result:
[Syntax Error] line 0, col 31: Error: Expected Doctrine\ORM\Query\Lexer::T_SET, got '`'
QueryException: [Syntax Error] line 0, col 31: Error: Expected Doctrine\ORM\Query\Lexer::T_SET, got '`'
QueryException: UPDATE AppBundle:ChangeAPI SET `key`='asd123' WHERE `id` = 1
Can someone help me? Thanks.
AppBundle.ChangeAPIinstead ofAppBundle:ChangeAPI?`character