This function generates a query to fetch information like (at least) last modification date (last_modified) number of entries (count) number of new entries (neue) from object_user_visits for a specific module, denoted by $type. You pass a table-name ($table_name), where the entries for the module are stored, the name of the field working as foreign-key ($range_field), the field to count the number of (new) entries ($count_field). The if-clause ($if_clause) is used to check if there are any new entries at all. With $add_fields you can specify some further fields to be fetched in the query With $add_on you can add some conditions to hold when joining object_user_visits. $object_field is the name of field in object_user_visits to join with
- Parameters
-
string | $table_name | the name of the db-table where the entries for the module denoted by $type are stored in |
string | $range_field | name of the field working as foreign-key, when joining object_user_visits |
string | $count_field | field to count the (new) entries on |
string | $if_clause | an sql-if-clause, used to check if there are any new entries at all |
string | $type | |
string | $add_fields | some further fields to be fetched in the query |
string | $add_on | some further conditions to hold when joining object_user_visits |
string | $object_field | default: my.object_id. |
string | $user_id | default: current user, user-id of user the query is built for |
string | $max_field | default: chdate, denotes the field used to find out the last_modified-timestamp |
- Returns
- string the query to operate on objects_user_visits