Welcome Guest, Not a member yet? Register   Sign In
Determine if CodeIgniter’s Model Save() is Insert or Update
#3

From the docs,
Quote:This (save()) is a wrapper around the insert() and update() methods that handle inserting or updating the record automatically, based on whether it finds an array key matching the $primaryKey value:

So, to check if it is an insert() or update() method, I'll suggest you do that by checking your $primaryKey.
Reply


Messages In This Thread
RE: Determine if CodeIgniter’s Model Save() is Insert or Update - by sammyskills - 12-28-2020, 08:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB