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.

trash_object_list

Summary

Fetches the objects that are in the trash.

Usage

fetch( 'content', 'trash_object_list',
       hash( [ 'offset', offset, ]
                [ 'limit',  limit   ]
                [ 'attribute_filter',   attribute_filter   ]
                [ 'sort_by',   sort_by   ]
                [ 'as_object',   as_object   ] ) )

Parameters

NameTypeDescriptionRequired
offset integer The offset to start at. No.
limit integer The number of objects that should be returned. No.
attribute_filter mixed A new parameter since eZ Publish 4.1. This enables attribute filtering. No.
sort_by mixed A new parameter since eZ Publish 4.1. This enables sorting. No.
as_object boolean A new parameter since eZ Publish 4.1. This enables fetching elements as objects. No.

Returns

An array of ezcontentobject objects or FALSE.

Description

This function fetches all the objects that are in the trash. An object is considered to be in the trash if its status field is set to "archived". The optional "offset" and "limit" parameters can be used to limit the result. The function returns an array of ezcontentobject objects or FALSE if no objects are found.

For more information regarding the use of the "attribute_filter" parameter, please visit the following page.

Examples

Example 1

{def $trashed_objects=fetch( 'content', 'trash_object_list' ) }
 
{foreach $trashed_objects as $object}
    {$object.name|wash} <br />
{/foreach}

Outputs the names of the objects that are in the trash.

Example 2

fetch('content', 'trash_object_list', hash('attribute_filter', array(...), 'sort_by', array(), 'as_object', true()))</pre>

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

Ester Heylen (18/11/2009 3:29 pm)

Balazs Halasy, Ester Heylen


Comments

There are no comments.