2 comments
Comment actions Permalink

Hi Stephen,

How $ticket_row is defined, what type (in other words, what do you see when invoking "View | Quick Documentation Lookup" on it)?

Try adding this PHPDoc comment after $ticket_row definition/assignment (or whenever you are using it -- separate template file, I guess):

/** @var stdClass $ticket_row */

As of v2.1 (I believe) PhpStorm will not mark such fields as undefined for stdClass ( http://youtrack.jetbrains.net/issue/WI-2839?projectKey=WI )

but why doesn't the IDE know these are elements of an array

Maybe because PhpStorm does not actually execute your SQL commands and therefore does not know which fields are returned etc.

0
Comment actions Permalink

Ok got it. Thanks.

PS: $ticket_row

foreach ($db->get_results($sql) as $ticket_row) { ....

get_resutls() is a method in my databsse class (a heavly modified version of the ezsql database class). The method runs a query and returns the resutls in an array. The class itself is a wrapper around mysqli (and the PDO - sometimes).

0

Please sign in to leave a comment.