Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP Warning – yii\base\ErrorException
- Invalid argument supplied for foreach()
- 1. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\BaseActiveRecord.php at line 1047
- 1038103910401041104210431044104510461047104810491050105110521053105410551056
- * record to trigger the [[EVENT_AFTER_FIND|afterFind Event]].
- *
- * @param BaseActiveRecord $record the record to be populated. In most cases this will be an instance
- * created by [[instantiate()]] beforehand.
- * @param array $row attribute values (name => value)
- */
- public static function populateRecord($record, $row)
- {
- $columns = array_flip($record->attributes());
- foreach ($row as $name => $value) {
- if (isset($columns[$name])) {
- $record->_attributes[$name] = $value;
- } elseif ($record->canSetProperty($name)) {
- $record->$name = $value;
- }
- }
- $record->_oldAttributes = $record->_attributes;
- }
- 2. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\BaseActiveRecord.php – yii\base\ErrorHandler::handleError(2, 'Invalid argument supplied for fo...', 'C:\xampp\htdocs\advanced\vendor\...', 1047, ...) at line 1047
- 3. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\ActiveQueryTrait.php – yii\db\BaseActiveRecord::populateRecord(common\models\Vbpl, null) at line 132
- 4. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2-mongodb\ActiveQuery.php – yii\mongodb\ActiveQuery::createModels([null]) at line 215
- 209210211212213214215216217218219220221
- public function populate($rows)
- {
- if (empty($rows)) {
- return [];
- }
- $models = $this->createModels($rows);
- if (!empty($this->with)) {
- $this->findWith($this->with, $models);
- }
- if (!$this->asArray) {
- foreach ($models as $model) {
- $model->afterFind();
- 5. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2-mongodb\ActiveQuery.php – yii\mongodb\ActiveQuery::populate([null]) at line 154
- 148149150151152153154155156157158159160
- * if the query results in nothing.
- */
- public function one($db = null)
- {
- $row = parent::one($db);
- if ($row !== false) {
- $models = $this->populate([$row]);
- return reset($models) ?: null;
- } else {
- return null;
- }
- }
- 6. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\BaseActiveRecord.php – yii\mongodb\ActiveQuery::one() at line 136
- 7. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\db\BaseActiveRecord.php – yii\db\BaseActiveRecord::findByCondition('54bc6960498fb4a015000029', true) at line 101
- 8. in C:\xampp\htdocs\advanced\backend\modules\vbpl\controllers\VbplController.php – yii\db\BaseActiveRecord::findOne('54bc6960498fb4a015000029') at line 115
- 109110111112113114115116117118119120121
- * @param integer $_id
- * @return Vbpl the loaded model
- * @throws NotFoundHttpException if the model cannot be found
- */
- protected function findModel($id)
- {
- if (($model = Vbpl::findOne($id)) !== null) {
- return $model;
- } else {
- throw new NotFoundHttpException('The requested page does not exist.');
- }
- }
- }
- 9. in C:\xampp\htdocs\advanced\backend\modules\vbpl\controllers\VbplController.php – backend\modules\vbpl\controllers\VbplController::findModel('54bc6960498fb4a015000029') at line 52
- 46474849505152535455565758
- * @param integer $_id
- * @return mixed
- */
- public function actionView($id)
- {
- return $this->render('view', [
- 'model' => $this->findModel($id),
- ]);
- }
- /**
- * Creates a new Vbpl model.
- * If creation is successful, the browser will be redirected to the 'view' page.
- 10. backend\modules\vbpl\controllers\VbplController::actionView('54bc6960498fb4a015000029')
- 11. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\InlineAction.php – call_user_func_array([backend\modules\vbpl\controllers\VbplController, 'actionView'], ['54bc6960498fb4a015000029']) at line 55
- 12. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php – yii\base\InlineAction::runWithParams(['r' => 'vbpl/vbpl/view', 'id' => '54bc6960498fb4a015000029']) at line 151
- 13. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Module.php – yii\base\Controller::runAction('view', ['r' => 'vbpl/vbpl/view', 'id' => '54bc6960498fb4a015000029']) at line 455
- 14. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\web\Application.php – yii\base\Module::runAction('vbpl/vbpl/view', ['r' => 'vbpl/vbpl/view', 'id' => '54bc6960498fb4a015000029']) at line 83
- 15. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Application.php – yii\web\Application::handleRequest(yii\web\Request) at line 375
- 16. in C:\xampp\htdocs\advanced\backend\web\index.php – yii\base\Application::run() at line 18
- 12131415161718
- require(__DIR__ . '/../../common/config/main-local.php'),
- require(__DIR__ . '/../config/main.php'),
- require(__DIR__ . '/../config/main-local.php')
- );
- $application = new yii\web\Application($config);
- $application->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement