Answer the question
In order to leave comments, you need to log in
Why can it be that ActiveRecord saves empty values in the database?
Good night all.
Faced a strange effect - the save method of an AR instance returns true, zero errors, creates a new row in the database, but all the fields in it are empty (even the one marked as CURRENT_TIMESTAMP by default). From the point of view of the code, everything simply should not work.
$arBanners = new Banners();
$arBanners->setAttributes([
'type' => 'sometype',
'image' => 'someurl'
]);
$arBanners->save(false); // даже если валидацию не отключить, эффект будет тем же самым
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question