Skip to content

Instantly share code, notes, and snippets.

@kochen
Last active November 2, 2015 19:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kochen/75d22e17b5181e21123b to your computer and use it in GitHub Desktop.
Save kochen/75d22e17b5181e21123b to your computer and use it in GitHub Desktop.
DOCman 2.0 Stable - get list of documents
<?
$catid = 2; //could also be an array(1,2,3,4)
/**
* returns a KModelEntityRowset, where each item is a KModelEntityRow.
* in the case of documents it returns a special document entity (the Rowset is filtered by the requested category.
*
* the document entity has (among other things):
* - $document->title (text)
* - $document->category (category entity object)
* - $document->storage_path (path entity to the file)
*/
$documents = KObjectManager::getInstance()->getObject('com://admin/docman.model.documents')
->category($catid)->fetch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment