API docs     >     Files     >     FileMgr

FileMgr->getTree

Description

getTree ( $fileId = NULL, $maxLevels = 2, $noTrash = true )
Get Files tree nodes

Parameters

$fileId
int
(optional) From which Page Id the tree should be returned
$maxLevels
int
(optional) Specifies the maximum level of nodes to get
$noTrash
bool
(optional) FALSE when item from the Trash should also be returned

Returns

array
Array of File nodes
  1. Array(                                      array Array of n Files
  2.     [0] => Array(
  3.         [LFT] => 1                          int Id of the left node in the nested set tree structure
  4.         [RGT] => 162                        int Id of the right node in the nested set tree structure
  5.         [VERSIONPUBLISHED] => 0             int Published version (either a specific version or 999999 if set to 'ALWAYS_LATEST_APPROVED_VERSION')
  6.         [ID] => 1                           int Id
  7.         [LEVEL] => 1                        int Level in tree
  8.         [PARENT] => 0                       int Parent Id
  9.         [PNAME] => 'File'                   string Permanent name
  10.         [VERSION] => 0                      int Version
  11.         [FOLDER] => 1                       int 1 if folder, 0 if not
  12.         [FILENAME] => 'File.jpg'            string Filename
  13.         [FILETYPE] => 8                     int Type
  14.         [FILESIZE] => 0                     int Size
  15.         [EXTENSION] => 'JPG'                string File extension
  16.         [OID] => 1                          int Id
  17.         [NAME] => 'File'                    string Name
  18.         [DESCRIPTION] => 'File desc'        string Description (dynamic Property)
  19.         [CREATEDTS] => 0                    int Timestamp of the creation
  20.         [CHANGEDTS] => 0                    int Timestamp of the last change
  21.         [CREATEDBY] => 0                    int Id of the User who created the Object
  22.         [CHANGEDBY] => 0                    int Id of the last User who touched the Object
  23.         [RREAD] => 1                        int 1 if User owns Permissions to read this Object, 0 if not
  24.         [RWRITE] => 1                       int 1 if User owns Permissions to write this Object, 0 if not
  25.         [RDELETE] => 1                      int 1 if User owns Permissions to delete this Object, 0 if not
  26.         [RSUB] => 1                         int 1 if User owns Permissions to create subnodes under this Object, 0 if not
  27.         [RSTAGE] => 1                       int 1 if User owns Permissions to publish/approve this Object, 0 if not
  28.         [RMODERATE] => 1                    int 1 if User owns Permissions to moderate Comments of this Object, 0 if not
  29.         [RCOMMENT] => 1                     int 1 if User owns Permissions to add Comments to this Object, 0 if not
  30.     )
  31.     ...
  32. )