Welcome Guest, Not a member yet? Register   Sign In
Accessing a custom object with instanceof
#1

(This post was last modified: 01-26-2021, 12:08 AM by baxterheinen.)

I have instantiated a new object from a class in my app/libraries folder as such:

PHP Code:
// in controller
use App\Libraries\LN_Account


PHP Code:
// in controller method
$account = new LN_Account(); 


But when I pass $account to my model and check if it is an instance of LN_Account the conditional fails. 

PHP Code:
// in controller method
$account $this->AuthenticationModel->getAuthenticationCredentials($account); 



PHP Code:
// in model
public function getAuthenticationCredentials($account) {
    if ($account instanceof LN_Account) {
         // I never get here
     }




How do I make LN_Account visible to my model?
Reply


Messages In This Thread
Accessing a custom object with instanceof - by baxterheinen - 01-25-2021, 11:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB