{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10635","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10635/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10635/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10635/events","html_url":"https://github.com/yiisoft/yii2/issues/10635","id":127891258,"number":10635,"title":"Call to undefined method yii\\web\\View::findByCondition()","user":{"login":"bologer","id":9879933,"avatar_url":"https://avatars.githubusercontent.com/u/9879933?v=3","gravatar_id":"","url":"https://api.github.com/users/bologer","html_url":"https://github.com/bologer","followers_url":"https://api.github.com/users/bologer/followers","following_url":"https://api.github.com/users/bologer/following{/other_user}","gists_url":"https://api.github.com/users/bologer/gists{/gist_id}","starred_url":"https://api.github.com/users/bologer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bologer/subscriptions","organizations_url":"https://api.github.com/users/bologer/orgs","repos_url":"https://api.github.com/users/bologer/repos","events_url":"https://api.github.com/users/bologer/events{/privacy}","received_events_url":"https://api.github.com/users/bologer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-21T10:21:58Z","updated_at":"2016-01-21T10:38:28Z","closed_at":null,"body":"Shows the following error:\r\n```\r\nPHP Fatal Error – yii\\base\\ErrorException\r\n\r\nCall to undefined method yii\\web\\View::findByCondition()\r\n```\r\n\r\nin `/vendor/yiisoft/yii2/db/BaseActiveRecord.php` and shows this part of the file: \r\n\r\n```php\r\nprivate $_related = [];\r\n \r\n \r\n    /**\r\n     * @inheritdoc\r\n     * @return static|null ActiveRecord instance matching the condition, or `null` if nothing matches.\r\n     */\r\n    public static function findOne($condition)\r\n    {\r\n        return static::findByCondition($condition)->one();\r\n    }\r\n \r\n    /**\r\n     * @inheritdoc\r\n     * @return static[] an array of ActiveRecord instances, or an empty array if nothing matches.\r\n     */\r\n    public static function findAll($condition)\r\n    {\r\n        return static::findByCondition($condition)->all();\r\n```\r\n\r\nThis is where error comes from. File: LoanStatus.php\r\n```php\r\n<?php\r\nnamespace frontend\\models;\r\n\r\nuse Yii;\r\nuse yii\\base\\NotSupportedException;\r\nuse yii\\db\\ActiveRecord;\r\nuse common\\models\\User;\r\nuse frontend\\models\\Loan;\r\n\r\n// Loan model class\r\nclass LoanStatus extends ActiveRecord {\r\n\r\n\tpublic static function tableName() {\r\n\t\treturn 'loan_status';\r\n\t}\r\n\r\n\tpublic static function getLoaner($loanId) {\r\n\t\t$loan = self::findOne(['loan_id' => $loanId]);\r\n\r\n\t\treturn User::findOne($loan->user_id_loaner);\r\n\t}\r\n```\r\n\r\nI call function `getLoaner()` from `LoanStatus`, `LoanStatus::getLoaner($loanid)` in the view file. After refreshing the page I receive the error about, which is written in the name of this issue request.\r\n\r\nTable loan_status has the following structure\r\n[loan_status table structure](http://dl3.joxi.net/drive/0006/2127/395343/160121/aa7ab6a9d2.png)\r\n\r\nAnd the problem is that I cannot fix this issue for some reason and I do not know what causing this problem. \r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/173532026","html_url":"https://github.com/yiisoft/yii2/issues/10635#issuecomment-173532026","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/10635","id":173532026,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T10:38:28Z","updated_at":"2016-01-21T10:38:28Z","body":"Could you post stacktrace please?"}}