Path / documentation / ez publish / technical manual / 3.7 / reference / modules / content / fetch functions / object_count_by_user_id

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



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


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


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


The number of objects (as an integer).


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.


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

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

Balazs Halasy (06/02/2004 12:10 pm)

Svitlana Shatokhina (05/06/2006 2:49 pm)

Balazs Halasy, Svitlana Shatokhina


  • is it possible to fetch object_by_user_id?

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