Hi all,
I'm experiencing an odd situation where it appears findFirst() is returning an existing object, even though I have no caching. I'm pretty sure this is just a brain fart on my part, but I need someone else to point it out.
Example code:
# This part works as expected - the record is created in the database
$AppPage = new AppPage();
$AppPage->save([
'parent_id'=>2,
'path'=>'/appPage',
'type'=>'App',
'title'=>'App page',
'menu_title'=>'App page'
]);
# "foo" is not a column in the database, nor is it a property declared in the model,
# so "foo" should only exist on this particluar object
$AppPage->foo = 'bar';
$ReloadedPage = AppPage::findFirst($AppPage->id);
echo $ReloadedPage->foo; # outputs "bar"
I'm positive I haven't set up any model caching. In fact, when I view my query log, I can see a second SELECT clause being run, corresponding to the second findFirst()
call.
What am I missing?