title: Doctrine Same query, getResult vs getArrayResult returning different results
body: <p>Building the following query:</p>
  
  <pre><code>$q = $this
      -&gt;createQueryBuilder('a')
      -&gt;select('a')
      -&gt;where('a.account = :accountId')
      -&gt;andWhere('a.organization = :organization_id')
      -&gt;setParameters(
          array(
              'accountId' =&gt; $account_id,
              'organization_id' =&gt; $organization_id,
          )
      )
      -&gt;getQuery();
  </code></pre>
  
  <p>When calling getResult() (and counting the result set):  <code>$attributes = count($q-&gt;getResult());</code> The result is 1 row returned (which is incorrect).</p>
  
  <p>But, when calling getResultArray <code>$attributes = count($q-&gt;getArrayResult());</code> The result is 2 (which is correct)</p>
  
  <p><strong>Table Schema:</strong></p>
  
  <pre><code>CREATE TABLE 'accountattribute' (
    'account_id' int(11) NOT NULL,
    'organization_id' int(11) NOT NULL,
    'dataKey' varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
    'dataValue' text COLLATE utf8_unicode_ci NOT NULL,
    'updated' datetime NOT NULL,
    'created' datetime NOT NULL,
    PRIMARY KEY ('account_id','organization_id','dataKey'),
    KEY 'organization_id' ('organization_id'),
    CONSTRAINT 'accountattribute_ibfk_1' FOREIGN KEY ('account_id') REFERENCES 'accounts' ('id'),
    CONSTRAINT 'accountattribute_ibfk_2' FOREIGN KEY ('organization_id') REFERENCES 'organizations' ('id')
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>
  
  <p><strong>Expected result:</strong></p>
  
  <pre><code>    [
      {
          data_key: "foo",
          data_key: "bar",
          updated: "2014-05-10T21:09:56+0000",
          created: "2014-05-10T21:09:56+0000",
          account: {
              id: 1,
              display_name: "Test Account",
              organization: {
                  id: 1,
                  display_name: "NAME"
              },
              active: true,
              deleted: false,
              updated: "2014-05-09T15:25:16+0000",
              created: "2014-05-09T15:25:16+0000"
          },
          organization: {
              id: 1,
              display_name: "NAME"
          },
      },
      {
          data_key: "nice",
          data_key: "ace",
          updated: "2014-05-11T01:04:43+0000",
          created: "2014-05-11T01:04:43+0000",
          account: {
              id: 1,
              display_name: "Test Account",
              organization: {
                  id: 1,
                  display_name: "NAME"
              },
              active: true,
              deleted: false,
              updated: "2014-05-09T15:25:16+0000",
              created: "2014-05-09T15:25:16+0000"
          },
          organization: {
              id: 1,
              display_name: "NAME"
          },
      }
  ]
  </code></pre>
  
  <p><strong>Actual Result (when using getResult)</strong></p>
  
  <pre><code>[
      {
          account: {
              id: 1,
              display_name: "Test Account",
              organization: {
                  id: 1,
                  display_name: "NAME"
              },
              active: true,
              deleted: false,
              updated: "2014-05-09T15:25:16+0000",
              created: "2014-05-09T15:25:16+0000"
          },
          organization: {
              id: 1,
              display_name: "NAME"
          },
          data_key: "foo",
          data_value: "bar",
          updated: "2014-05-10T21:09:56+0000",
          created: "2014-05-10T21:09:56+0000"
      }
  ]
  </code></pre>
  
  <p><strong>Actual Result (when using getArrayResult)</strong></p>
  
  <pre><code>[
      {
          account: {
              id: 1,
              display_name: "Test Account",
              organization: {
                  id: 1,
                  display_name: "NAME"
              },
              active: true,
              deleted: false,
              updated: "2014-05-09T15:25:16+0000",
              created: "2014-05-09T15:25:16+0000"
          },
          organization: {
              id: 1,
              display_name: "NAME"
          },
          data_key: "foo",
          data_value: "bar",
          updated: "2014-05-10T21:09:56+0000",
          created: "2014-05-10T21:09:56+0000"
      }
  ]
  </code></pre>