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

(This post was last modified: 01-26-2021, 06:38 PM by baxterheinen.)

(01-26-2021, 06:34 PM)iRedds Wrote:
(01-26-2021, 06:18 PM)baxterheinen Wrote: The specific error is: Class 'LN_Account' not found

15 years  Big Grin

Of course you will get an error.

PHP Code:
//use 
->getCustomRowObject(0, 'App\\Libraries\\LN_Account');
// or
->getCustomRowObject(0, LN_Account::class); 


Ah, because it's not already an object, got it.

(01-26-2021, 06:37 PM)baxterheinen Wrote:
(01-26-2021, 06:34 PM)iRedds Wrote:
(01-26-2021, 06:18 PM)baxterheinen Wrote: The specific error is: Class 'LN_Account' not found

15 years  Big Grin

Of course you will get an error.

PHP Code:
//use 
->getCustomRowObject(0, 'App\\Libraries\\LN_Account');
// or
->getCustomRowObject(0, LN_Account::class); 


Ah, because it's not already an object, got it.

Why don't the docs cover this? They say the autoloader will instantiate it. 

https://codeigniter.com/user_guide/datab...sults.html
Reply


Messages In This Thread
RE: Accessing a custom object with instanceof - by baxterheinen - 01-26-2021, 06:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB