I think every single function in DB.php has the first argument as $table ... except findById().
Is there a reason for this? Maybe if I had the reason for it in my mind I would make the mistake less often...
The function pretty much always needs to know what table to look in. We could make a searchDB function or something that would search the whole db.
What do you see as the downside with this?
Sorry, I wasn't clear. My concern wasn't that every function has table as the first argument - my concern is that findById doesn't. It's the inconsistency in the order of arguments that I'm asking about.
@mudmin will definitely need to answer that one...I got nothing except agreement with you.
What do you think a solution would be? What are your thoughts on swapping the arguments in US5 for example.
I was going to make up a more educated sounding answer, but that method was actually the first method I ever wrote on my own. I used something similar in a procedural php class that I took on Udemy when I first started coding. I thought it would be a nice feature to have.
The method is not actually used anywhere in the UserSpice code. I didn't notice that until after I pushed 4.0 and got a few thousand downloads. I thought about changing it, but then if anyone implemented it, it would break their code. I'd kind of like to flip it for 5.0 and just document the change.
I think you got the wrong thread on this one @mudmin...