\MatthiasWeb\RealMediaLibrary\apiIStructure

Structure implementation for Real Media Library. It handles all SQL query which reads all folders from the database and "collects" it into one tree. You can modify the structure queries by RML/Tree* filters and extending the MatthiasWeb\RealMediaLibrary\attachment\Structure class (implements IStructure).

Summary

Methods
Constants
__construct()
initialLoad()
resetData()
byId()
byAbsolutePath()
getRows()
getParsed()
getTree()
getPlainTree()
getCntAttachments()
getCntRoot()
getData()
setData()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__construct()

__construct(integer  $root = null,array  $data = null)

Start reading a structure. If you pass a $root parameter the parameter is not automatically respected. You should then use your own implementation or filters to respect the root. Use this constructor to add your filters and respect your custom Structure class implementation.

Parameters

integer $root

The root folder defined for the structure

array $data

Custom data for the structure

initialLoad()

initialLoad()

Checks, if the SQL result is available and load it if not.

resetData()

resetData(integer  $root = null,boolean  $fetchData = true)

Resets the data of the structure.

Parameters

integer $root

The root folder

boolean $fetchData

Determine, if the data should be re-fetched

byId()

byId(integer  $id,boolean  $nullForRoot = true): \MatthiasWeb\RealMediaLibrary\api\IFolder|null

Get a folder by id.

Parameters

integer $id

The id of the folder

boolean $nullForRoot

If set to false and $id == -1 then the Root instance is returned

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder|null

byAbsolutePath()

byAbsolutePath(string  $path): \MatthiasWeb\RealMediaLibrary\api\IFolder|null

Get a folder by absolute path.

Parameters

string $path

The path

Returns

\MatthiasWeb\RealMediaLibrary\api\IFolder|null

getRows()

getRows(): array<mixed,object>

Get the SQL query result instead of IFolder objects.

Returns

array<mixed,object> —

The SQL result

getParsed()

getParsed(): array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

Get all SQL query results as IFolder objects.

Returns

array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder> —

The folders

getTree()

getTree(): array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder>

Get all SQL query results placed to a tree. That means it is a "hierarchical" result where you work with ->getChildren(). The first level contains the top folders.

Returns

array<mixed,\MatthiasWeb\RealMediaLibrary\api\IFolder> —

The folders

getPlainTree()

getPlainTree(): array<mixed,object>

Get all SQL query results placed to a tree. It is fully resolved with all hierarchical plain objects of the folders expect the invisible nodes.

Returns

array<mixed,object>

getCntAttachments()

getCntAttachments(): integer

Get the attachment count for this structure.

Returns

integer —

Count

getCntRoot()

getCntRoot(): integer

Get the attachment count for the "Unorganized" folder for this structure.

Returns

integer —

Count

getData()

getData(): array

Get the custom data.

Returns

array —

Data

setData()

setData(array  $data)

Set the custom data.

Parameters

array $data

The custom data