Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2093

Doctrine Criteria does not support sorting by relationed field

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      // Here I call Criteria filter
      public function getWalletsActive() {
      	$criteria = Criteria::create()
      		->where(Criteria::expr()->eq("isRemoved", "0"))
      		->orderBy(array("currency.id" => "ASC"));
      	return $this->wallets->matching($criteria);
      }
      
      // Relation
      /**
       * @var Currency
       *
       * @ORM\ManyToOne(targetEntity="Currency")
       * @ORM\JoinColumns({
       * @ORM\JoinColumn(name="id_currency", referencedColumnName="id")
       * })
       */
      protected $currency;
      
      // File BasicEntityPersister.php
      // This cause the problem:
      if ( ! isset($this->_class->fieldMappings[$fieldName])) {
          throw ORMException::unrecognizedField($fieldName);
      }
      // There are no relations in $this->_class->fieldMappings at all!
      

        Activity

        Bogdan Yurov created issue -
        Hide
        Benjamin Eberlei added a comment -

        Mark as improvement.

        Show
        Benjamin Eberlei added a comment - Mark as improvement.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] Improvement [ 4 ]

        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=DDC-2093, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Bogdan Yurov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: