Document Lists

Skip to end of metadata
Go to start of metadata

Documents can be retrieved in the form of a document list just in the same manner as object lists. For example, if all documents modified in the last hour should be retrieved this code would do it:

$list = new Document_List();
$list->setCondition("modificationDate > " . time() - ( 60 * 60) );
$documents= $list->load();

Include unpublished Documents in the List (since 1.0.3, nightly 750)

Normally document lists only return published documents if you are not in pimcore admin mode. To get unpublished documents in the frontend, the "unpublished" property of the list must be set to true before loading it:

$list = new Document_List();
$list->setCondition("modificationDate > " . time() - ( 60 * 60) );
$list->setUnpublished(true);
$documents = $list->load();

Using prepared statement placeholders and variables (since 1.4.2)

The syntax is similar to that from the Zend Framework described here: http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.select.fetchall

// using a single variable
$list = new Document_List();
$list->setCondition("modificationDate > ?",  (time() - ( 60 * 60)) );
$documents= $list->load();


// using more variables / placeholders
$list = new Document_List();
$list->setCondition("modificationDate > ? AND type = ?",  array(time(), "page") );
$documents= $list->load();

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.