{"id":327,"date":"2021-03-17T14:56:22","date_gmt":"2021-03-17T17:56:22","guid":{"rendered":"http:\/\/hackerzone.com.br\/blog\/?p=327"},"modified":"2022-08-13T00:19:52","modified_gmt":"2022-08-13T03:19:52","slug":"doctrine-orm-mysql-problemas-com-palavras-reservadas-solucao","status":"publish","type":"post","link":"http:\/\/hackerzone.com.br\/blog\/doctrine-orm-mysql-problemas-com-palavras-reservadas-solucao\/","title":{"rendered":"Doctrine ORM + MySQL problemas com palavras reservadas &#8211; Solu\u00e7\u00e3o"},"content":{"rendered":"<p>se voc\u00ea esta tendo problema com palavras reservadas no Doctrine + ORM a solu\u00e7\u00e3o \u00e9 bem simples, basta voc\u00ea adicionar aspas invertidas na defini\u00e7\u00e3o do nome da coluna do banco de dados, exemplo:<\/p>\n<p>Entity Product (Com erro, sem aspas simples invertidas)<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/**\r\n * @var string|null\r\n *\r\n * @ORM\\Column(name=&quot;condition&quot;, type=&quot;string&quot;, length=45, nullable=true)\r\n *\/\r\n private $condition;\r\n<\/pre>\n<p>Entity Product (Sem erro, com aspas simples invertidas)<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/**\r\n * @var string|null\r\n *\r\n * @ORM\\Column(name=&quot;`condition`&quot;, type=&quot;string&quot;, length=45, nullable=true)\r\n *\/\r\n private $condition;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>se voc\u00ea esta tendo problema com palavras reservadas no Doctrine + ORM a solu\u00e7\u00e3o \u00e9 bem simples, basta voc\u00ea adicionar aspas invertidas na defini\u00e7\u00e3o do nome da coluna do banco de dados, exemplo: Entity Product (Com erro, sem aspas simples invertidas) Entity Product (Sem erro, com aspas simples invertidas)<\/p>\n","protected":false},"author":1,"featured_media":459,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,12,13],"tags":[16,146,17,147,148],"class_list":["post-327","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-doctrine","category-php","category-zend-framework-3","tag-doctrine","tag-doctrine-orm","tag-mysql","tag-palavras-reservadas","tag-reserved-words","cat-14-id","cat-12-id","cat-13-id","has_thumb"],"_links":{"self":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":1,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":329,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/327\/revisions\/329"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/media\/459"}],"wp:attachment":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}