Jump to content

Trace a function call


NotSureILikePHP

Recommended Posts

I'm assuming this is a function in php, though still not entirely sure what arrows are in coding. Here's the line:

 

if ($filters)
    $custs->filter($filters);
 

[/]

 

$Custs is an object of type customer. Other languages don't have -> but if I'm not mistaken it's a  function. I'm searching the entire project for "function filter" and I get 3 results but none of them are the right location. Only one of them accepts parameters and I know it's not the right code because it never reaches that function. Can someone tell me exactly what I should be looking for?

 

I'm trying to search for a specific customer. However it's searching on customer name = "whatever" rather than customer name like "whatever" and I can't seem to find where it's defined in the code.

Link to comment
Share on other sites

-> is the operator used to access class properties or methods. filter() in this case is a method in the object that $custs references.

 

You can find the full class name to the object $custs is referencing with echo get_class($custs); Then, find that class and you'll find your filter method.

  • Like 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.