{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/8167","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/8167/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/8167/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/8167/events","html_url":"https://github.com/yiisoft/yii2/issues/8167","id":70554433,"number":8167,"title":"[Enh] Add PINQ ability to Yii2 Active Record","user":{"login":"nicovicz","id":2552031,"avatar_url":"https://avatars.githubusercontent.com/u/2552031?v=3","gravatar_id":"","url":"https://api.github.com/users/nicovicz","html_url":"https://github.com/nicovicz","followers_url":"https://api.github.com/users/nicovicz/followers","following_url":"https://api.github.com/users/nicovicz/following{/other_user}","gists_url":"https://api.github.com/users/nicovicz/gists{/gist_id}","starred_url":"https://api.github.com/users/nicovicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicovicz/subscriptions","organizations_url":"https://api.github.com/users/nicovicz/orgs","repos_url":"https://api.github.com/users/nicovicz/repos","events_url":"https://api.github.com/users/nicovicz/events{/privacy}","received_events_url":"https://api.github.com/users/nicovicz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-24T01:09:42Z","updated_at":"2015-04-24T07:45:52Z","closed_at":null,"body":"hello, it's posible to add ability PINQ (LINQ php version) on Yii2 Active Record?\r\nbased on\r\nhttp://elliotswebsite.com/Pinq/\r\n\r\nexample\r\n```php\r\n$youngPeopleDetails = $people\r\n        ->where(function ($row) { return $row['age'] <= 50; })\r\n        ->orderByAscending(function ($row) { return $row['firstName']; })\r\n        ->thenByAscending(function ($row) { return $row['lastName']; })\r\n        ->take(50)\r\n        ->indexBy(function ($row) { return $row['phoneNumber']; })\r\n        ->select(function ($row) { \r\n            return [\r\n                'fullName'     => $row['firstName'] . ' ' . $row['lastName'],\r\n                'address'       => $row['address'],\r\n                'dateOfBirth' => $row['dateOfBirth'],\r\n            ]; \r\n        })\r\n```\r\n\r\nif in Yii it would like this\r\n```php\r\n$people = People::find();\r\n$youngPeopleDetails = $people\r\n        ->where(function ($row) { return $row['age'] <= 50; })\r\n        ->orderByAscending(function ($row) { return $row['firstName']; })\r\n        ->thenByAscending(function ($row) { return $row['lastName']; })\r\n        ->take(50)\r\n        ->indexBy(function ($row) { return $row['phoneNumber']; })\r\n        ->select(function ($row) { \r\n            return [\r\n                'fullName'     => $row['firstName'] . ' ' . $row['lastName'],\r\n                'address'       => $row['address'],\r\n                'dateOfBirth' => $row['dateOfBirth'],\r\n            ]; \r\n        })\r\n```\r\ni think it's more clean and readable\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/95837161","html_url":"https://github.com/yiisoft/yii2/issues/8167#issuecomment-95837161","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/8167","id":95837161,"user":{"login":"mdmunir","id":5828252,"avatar_url":"https://avatars.githubusercontent.com/u/5828252?v=3","gravatar_id":"","url":"https://api.github.com/users/mdmunir","html_url":"https://github.com/mdmunir","followers_url":"https://api.github.com/users/mdmunir/followers","following_url":"https://api.github.com/users/mdmunir/following{/other_user}","gists_url":"https://api.github.com/users/mdmunir/gists{/gist_id}","starred_url":"https://api.github.com/users/mdmunir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdmunir/subscriptions","organizations_url":"https://api.github.com/users/mdmunir/orgs","repos_url":"https://api.github.com/users/mdmunir/repos","events_url":"https://api.github.com/users/mdmunir/events{/privacy}","received_events_url":"https://api.github.com/users/mdmunir/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T07:45:52Z","updated_at":"2015-04-24T07:45:52Z","body":">hello, it's posible to add ability PINQ (LINQ php version) on Yii2 Active Record?\r\n\r\nNo.\r\n>i think it's more clean and readable\r\n\r\nI think its more ugly. Current implementation much better."}}