Injecting language after PHP function
I need help creating the language injection settings for SQL code inside PHP file. I'm using active record for my database calls that look like this.
$this->db->where("Field = Value");
$this->db->select("Field1, Field2, Field3");
$this->db->from("mytable");
How do I get the injection to recognize the first string after $this->db->select(
Please sign in to leave a comment.
Hello,
Could you please clarify if you're using this code with CodeIgniter?
The question seems to be not IDE-specific so let's see if a community has something to share or contribute.
Correct, the code is using CodeIgniter MVC. I would still think it's IDE specific since I'm looking for the settings I need to enter for PHPStorm to recognize it as SQL code automatically.
Unfortunately PhpStorm doesn't fully support Active Record style code (CodeIgniter specifically).
As a workaround you can use @property annotations. Here's an article describing this workaround for PhpStorm but unfortunately it's in Russian. You still can give it a go via Google Translate/Chrome built-in translate plugin.
Thanks. Just to be clear, I don't care about auto complete on the active record method. The current SQL language injection looks for string literals like "SELECT * FROM table" I want to add an injection for strings following $this->db->select("SQL CODE HERE"). I just need help creating the "Places Pattern" which uses Program Structure Interface Patterns and I can't figure it out.