Welcome Guest, Not a member yet? Register   Sign In
PHPStorm yellow "Method not found in" notices
#1

(This post was last modified: 04-13-2020, 01:18 PM by Leo. Edit Reason: clarity )

Does anyone use PHPStorm? How do I fix the annoying method not found warnings\errors when using singleton instance of class across functions in controller?

PHP Code:
<?php namespace App\Controllers;

use 
App\Models\ProductsModel;

class 
Products extends BaseController
{
    protected $model;

    public function product_filters()
    {
        $this->model = new ProductsModel();
        $this->model->setTable('filters');
        $this->data['filters'] = $this->model->findAll();
////////////find all is lit up, declaration can be found

        if(isset($_POST)) {
            if (isset($_POST['add'])) {
                $this->new_filter();
            }
            return redirect()->to(current_url('products/product_filters'));
        }

        echo view('admin'$this->data);
        return null;
    }

    private function new_filter()
    {
        $name trim_and_filter('name');
        //check for existing, if no then insert
        if(!$this->model->where('name'$name)->first()) {
//////////here i keep getting yellow error method not found - but it works fine! How to fix this?? Its so annoying.
            $this->model->save(['name' => $name]);
        }
    }


You can see things I made with codeigniter here: itart.pro its not overly impressive as I have very little time to learn.
Reply


Messages In This Thread
PHPStorm yellow "Method not found in" notices - by Leo - 04-13-2020, 01:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB