07-11-2017, 09:43 PM
@faguss, I'm definitely interested in checking out your mods, I will say that there are some use cases for doing it the other way....
Assigning the query to a variable lets me get both a count and results or first. A lot of times, I don't want results() because I only want the first/only result and in that situation it simplifies the code to do first() because I don't have to deal with the full object by either doing a foreach or $results[0]->mycolumn;
Assigning the query to a variable lets me get both a count and results or first. A lot of times, I don't want results() because I only want the first/only result and in that situation it simplifies the code to do first() because I don't have to deal with the full object by either doing a foreach or $results[0]->mycolumn;