Does count PHP (and others languages) functions in models (query a COUNT() in SQL) should be named getCount($params) or count($params) ? Which is better ?
Thanks :)
getCountXxx() will be a good practice,
Example :
function init_example(){
$user_count = getCountXxx('some data if required');
}
function getCountXxx('data'){
//perform count
return $count;
}
I think if you want to access a data in an entity that contains a variable "countXXX", you should use getCountXXX(), without any parameter, unless, if you wan to count the number of element in something, you should use count, as you do the action of counting something. We could also discuss about making countXXX() something like count(XXX)