[eluser]bhogg[/eluser]
Hi all,
I might be missing something obvious, but it seems many of the return values of functions like $this->db->update() are not explicitly specified anywhere in the documentation.
As an example for $this->db->query():
"The query() function returns a database result object when "read" type queries are run, which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this:"
What about when a "read" type query is run and it fails, and assuming db debug is turned off? Does it return false? An empty object?
Things like $this->db->update() do not specify any return value in the documentation, so would need to test if doing something like:
Code:
if ($this->db->update('query...') !== FALSE)
{
// show error
}
does what I would expect. Since it's not specified, it could return a boolean, throw an exception, return nothing at all, or depend on some other error() type function to be checked after the call is completed.
Just a thought to make things a bit more explicit for newcomers and people transitioning from other frameworks who want as much control over their code as possible.
Cheers,
Brian