{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/3018","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/3018/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/3018/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/3018/events","html_url":"https://github.com/magento/magento2/issues/3018","id":127125839,"number":3018,"title":"Magento\\Sales\\Model\\OrderRepository::getList() is incomplete","user":{"login":"fooman","id":455508,"avatar_url":"https://avatars.githubusercontent.com/u/455508?v=3","gravatar_id":"","url":"https://api.github.com/users/fooman","html_url":"https://github.com/fooman","followers_url":"https://api.github.com/users/fooman/followers","following_url":"https://api.github.com/users/fooman/following{/other_user}","gists_url":"https://api.github.com/users/fooman/gists{/gist_id}","starred_url":"https://api.github.com/users/fooman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fooman/subscriptions","organizations_url":"https://api.github.com/users/fooman/orgs","repos_url":"https://api.github.com/users/fooman/repos","events_url":"https://api.github.com/users/fooman/events{/privacy}","received_events_url":"https://api.github.com/users/fooman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magento/magento2/labels/acknowledged","name":"acknowledged","color":"02d7e1"},{"url":"https://api.github.com/repos/magento/magento2/labels/bug","name":"bug","color":"eb6420"},{"url":"https://api.github.com/repos/magento/magento2/labels/CS","name":"CS","color":"fad8c7"}],"state":"closed","locked":false,"assignee":{"login":"NadiyaS","id":11783379,"avatar_url":"https://avatars.githubusercontent.com/u/11783379?v=3","gravatar_id":"","url":"https://api.github.com/users/NadiyaS","html_url":"https://github.com/NadiyaS","followers_url":"https://api.github.com/users/NadiyaS/followers","following_url":"https://api.github.com/users/NadiyaS/following{/other_user}","gists_url":"https://api.github.com/users/NadiyaS/gists{/gist_id}","starred_url":"https://api.github.com/users/NadiyaS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NadiyaS/subscriptions","organizations_url":"https://api.github.com/users/NadiyaS/orgs","repos_url":"https://api.github.com/users/NadiyaS/repos","events_url":"https://api.github.com/users/NadiyaS/events{/privacy}","received_events_url":"https://api.github.com/users/NadiyaS/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-01-17T21:37:01Z","updated_at":"2016-03-29T19:05:29Z","closed_at":"2016-03-28T16:57:40Z","body":"The implementation of the getList function seems to be missing code to deal with sort orders.\r\n\r\n    public function getList(\\Magento\\Framework\\Api\\SearchCriteria $searchCriteria)\r\n    {\r\n        //@TODO: fix search logic\r\n        /** @var \\Magento\\Sales\\Api\\Data\\OrderSearchResultInterface $searchResult */\r\n        $searchResult = $this->searchResultFactory->create();\r\n        foreach ($searchCriteria->getFilterGroups() as $filterGroup) {\r\n            foreach ($filterGroup->getFilters() as $filter) {\r\n                $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';\r\n                $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);\r\n            }\r\n        }\r\n        $searchResult->setCurPage($searchCriteria->getCurrentPage());\r\n        $searchResult->setPageSize($searchCriteria->getPageSize());\r\n        return $searchResult;\r\n    }\r\n\r\nvs this from the getList method in the customer repository class\r\n\r\n        $sortOrders = $searchCriteria->getSortOrders();\r\n        if ($sortOrders) {\r\n            /** @var SortOrder $sortOrder */\r\n            foreach ($searchCriteria->getSortOrders() as $sortOrder) {\r\n                $collection->addOrder(\r\n                    $sortOrder->getField(),\r\n                    ($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'\r\n                );\r\n            }\r\n        }\r\n\r\nOn a side note there also seems to be some inconsistency if a repository class is a resource model (customer module) or a model (like this one or catalog -> product repository)"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/203053755","html_url":"https://github.com/magento/magento2/issues/3018#issuecomment-203053755","issue_url":"https://api.github.com/repos/magento/magento2/issues/3018","id":203053755,"user":{"login":"rohitgupta4","id":6204389,"avatar_url":"https://avatars.githubusercontent.com/u/6204389?v=3","gravatar_id":"","url":"https://api.github.com/users/rohitgupta4","html_url":"https://github.com/rohitgupta4","followers_url":"https://api.github.com/users/rohitgupta4/followers","following_url":"https://api.github.com/users/rohitgupta4/following{/other_user}","gists_url":"https://api.github.com/users/rohitgupta4/gists{/gist_id}","starred_url":"https://api.github.com/users/rohitgupta4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohitgupta4/subscriptions","organizations_url":"https://api.github.com/users/rohitgupta4/orgs","repos_url":"https://api.github.com/users/rohitgupta4/repos","events_url":"https://api.github.com/users/rohitgupta4/events{/privacy}","received_events_url":"https://api.github.com/users/rohitgupta4/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T19:05:29Z","updated_at":"2016-03-29T19:05:29Z","body":"@mikeweis This is awesome, thank you for the update. QQ: Will this be a part of 2.0.3 release & is there an ETA for the release? Plmk."}}