I have this code:
$db->get()->query()
Now i want the get method’s return to depend on:
$db->get()
return $db->query var;
but
$db->get()->query()
the get() method will return $this
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Updated:
You can’t change the return depending on whether you’ve chained the code (which is what it looks like you want to do) – however for this particular problem you can implement the too string method which will ‘appear’ to do the same thing 🙂