Skip to the content
Documentation

trash_object_list

No ratings yet

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

Name Type Description Required
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 Exponential 4.1. This enables attribute filtering. No.
sort_by mixed A new parameter since Exponential 4.1. This enables sorting. No.
as_object boolean A new parameter since Exponential 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>

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.