Skip to the content
Documentation

object_count_by_user_id

No ratings yet

Summary

Fetches the number of objects (of a class) created by a user.

Usage

fetch( 'content', 'object_count_by_user_id',
       hash( 'class_id', class_id,
             'user_id',  user_id ) )

Parameters

Name Type Description Required
class_id integer The ID number of the target class. Yes.
user_id integer The ID number of the user (object ID). Yes.

Returns

The number of objects (as an integer).

Description

This function counts the number of objects (of a certain type) that were created by a user. Both the type of the object (the class) and the user must be specified. The function returns an integer revealing the number of objects that were found.

Examples

{def count=fetch( 'content', 'object_count_by_user_id', hash( 'class_id', 13, 'user_id', 14 ) )}
{$count}
{undef $count}

Outputs the number of objects (of class number 13) that have been created by user number 14.

Contributors

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. is it possible to fetch object_by_user_id?

    vytis ·

    is it possible to fetch all objects created by yser? something like object_by_user_id?

Comments

Add a comment

Comments are read by a moderator before they appear.