{"id":24,"date":"2013-07-18T17:20:05","date_gmt":"2013-07-18T11:20:05","guid":{"rendered":"http:\/\/sarojroy.com\/?p=24"},"modified":"2013-07-18T17:22:24","modified_gmt":"2013-07-18T11:22:24","slug":"doctrine-error-the-partial-field-selection-of-class-must-contain-the-identifier","status":"publish","type":"post","link":"http:\/\/sarojroy.com\/blog\/2013\/07\/18\/doctrine-error-the-partial-field-selection-of-class-must-contain-the-identifier\/","title":{"rendered":"Doctrine Error: The partial field selection of class must contain the identifier."},"content":{"rendered":"<p>Whenever performing a partial selection, you need to include the primary key of the class you&#8217;re selecting from.<\/p>\n<p>In my case, this error occurred when I tried to select a partial class without selecting the id field.<\/p>\n<p>Here is my previous code:<\/p>\n<pre class=\"brush: php; gutter: true\">$qb = $this-&gt;createQueryBuilder(&#039;d&#039;)\r\n           -&gt;select(array(&#039;partial d.{title, description}&#039;));<\/pre>\n<p>Here is my final code:<\/p>\n<pre class=\"brush: php; gutter: true\">$qb = $this-&gt;createQueryBuilder(&#039;d&#039;)\r\n           -&gt;select(array(&#039;partial d.{id, title, description}&#039;));<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Whenever performing a partial selection, you need to include the primary key of the class you&#8217;re selecting from. In my case, this error occurred when I tried to select a partial class without selecting the id field. Here is my previous code: $qb = $this-&gt;createQueryBuilder(&#039;d&#039;) -&gt;select(array(&#039;partial d.{title, description}&#039;)); Here is my final code: $qb = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,2],"tags":[25],"_links":{"self":[{"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/posts\/24"}],"collection":[{"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":14,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":37,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions\/37"}],"wp:attachment":[{"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sarojroy.com\/blog\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}