Doctrine 1
  1. Doctrine 1
  2. DC-909

Add Some Info to Doctrine Query order by Method Documentation

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      n/a

      Description

      This is very minor, but would have saved me a few minutes. On the Doctrine Query documentation page (V1 - http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#order-by-clause), it would be useful to note that multiple calls to Doctrine_Query::orderBy() do not stack, and that the later calls will over write the previous ones. I'll propose:

      To sort by multiple columns, you must specify them in one call to Doctrine_Query::orderBy(). If you call orderBy a second time, the column from the first call will not be included in the resulting query.

      <code>
      //works as expected
      //results in ORDER BY id ASC, userName DESC
      $query->orderBy('id ASC, userName DESC');

      //does not work as expected
      //results in ORDER BY userName DESC
      $query->orderBy('id ASC')
      ->orderBy('userName DESC');
      </code>

        Activity

        Isaac Foster created issue -

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-909, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Isaac Foster
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: