Overview
  • Namespace
  • Class

Namespaces

  • MatthiasWeb
    • RealMediaLibrary
      • api
      • attachment
      • base
      • comp
        • complexquery
      • folder
      • general
      • metadata
      • order
      • rest
      • usersettings
  • None

Classes

  • BaseFolder
  • Collection
  • Creatable
  • CRUD
  • Folder
  • Gallery
  • Root

Class Root

This class creates a root object. (Type 4) See parent classes / interfaces for better documentation.

MatthiasWeb\RealMediaLibrary\base\Base
Extended by MatthiasWeb\RealMediaLibrary\folder\BaseFolder implements MatthiasWeb\RealMediaLibrary\api\IFolder
Extended by MatthiasWeb\RealMediaLibrary\folder\Creatable
Extended by MatthiasWeb\RealMediaLibrary\order\Sortable
Extended by MatthiasWeb\RealMediaLibrary\folder\Root
Namespace: MatthiasWeb\RealMediaLibrary\folder
Located at folder/Root.class.php

Methods summary

public
# __construct( )

C'tor with the main properties.

C'tor with the main properties.

The constructor does not throw any errors because when it is fully filled with parameters it expects the right properties from the database.

Only ::instance and ::create should create instances from this class!

Synced with order\Sortable::__construct

Overrides

MatthiasWeb\RealMediaLibrary\order\Sortable::__construct
public
# persist( )

Persist the given creatable with the database. Think about it, that this only works, when the ID === -1 (that means, it will be a new folder).

Persist the given creatable with the database. Think about it, that this only works, when the ID === -1 (that means, it will be a new folder).

After the folder is created, this instance is useless, you must get the folder with the API wp_rml_get_by_id

Throws

Exception

Returns

integer ID of the newly created folder

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::persist
public
# getSlug( boolean $force = false, $fromSetName = false )

Returns a santitized title for the folder. If the slug is empty or forced to, it will be updated in the database, too.

Returns a santitized title for the folder. If the slug is empty or forced to, it will be updated in the database, too.

Parameters

$force
Forces to regenerate the slug
$fromSetName

Returns

string

Overrides

MatthiasWeb\RealMediaLibrary\folder\BaseFolder::getSlug
public
# getAbsolutePath( boolean $force = false, $fromSetName = false )

Creates a absolute path. If the absolute path is empty or forced to, it will be updated in the database, too.

Creates a absolute path. If the absolute path is empty or forced to, it will be updated in the database, too.

Parameters

$force
Forces to regenerate the absolute path
$fromSetName

Returns

string

Overrides

MatthiasWeb\RealMediaLibrary\folder\BaseFolder::getAbsolutePath
public
# getCnt( boolean $forceReload = false )

Gets the count of the files in this folder.

Gets the count of the files in this folder.

Parameters

$forceReload
If true the count cache gets reloaded

Since

3.3.1

Returns

int

Overrides

MatthiasWeb\RealMediaLibrary\folder\BaseFolder::getCnt
public
# setParent( integer $id, integer $ord = -1, boolean $force = false )

Changes the parent folder of this folder.

Changes the parent folder of this folder.

Parameters

$id
The new parent (use -1 for root)
$ord
The order number
$force
If true no permission checks are executed

Throws

Exception

Returns

boolean

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::setParent
public
# setName( string $name, boolean $supress_validation = false )

Renames a folder and then checks, if there is no duplicate folder in the parent folder.

Renames a folder and then checks, if there is no duplicate folder in the parent folder.

Parameters

$name
String New name of the folder
$supress_validation
Supress the permission validation

Throws

Exception

Returns

boolean

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::setName
public
# setRestrictions( string[] $restrictions = array() )

Set restrictions for this folder. Allowed restrictions for folders:

Set restrictions for this folder. Allowed restrictions for folders:

  • par Restrict to change the parent id
  • rea Restrict to rearrange the hierarchical levels of all subfolders (it is downwards all subfolders!) and can not be inherited
  • cre Restrict to create new subfolders
  • ins Restrict to insert/upload new attachments, automatically moved to root if upload
  • ren Restrict to rename the folder
  • del Restrict to delete the folder
  • mov Restrict to move files outside the folder

You can append a ">" after each permission so it is inherited in each created subfolder: "cre>", "ins>", ...

Parameters

$restrictions
Array with restrictions

Returns

boolean

Overrides

MatthiasWeb\RealMediaLibrary\folder\BaseFolder::setRestrictions
public IFolder[]
# getChildren( )

Get children of this folder.

Get children of this folder.

Returns

IFolder[]

Overrides

MatthiasWeb\RealMediaLibrary\folder\BaseFolder::getChildren
public boolean|int[]
# getAllowedChildrenTypes( )

Get all allowed children folder types.

Get all allowed children folder types.

Returns

boolean|int[]
Array with allowed types or TRUE for all types allowed
public
# getType( )

Return the type for the given folder. For example: 0 = Folder, 1 = Collection, 2 = Gallery

Return the type for the given folder. For example: 0 = Folder, 1 = Collection, 2 = Gallery

Returns

int
public
# getContentCustomOrder( )

The content custom order defines the state of the content order functionality:

The content custom order defines the state of the content order functionality:

0 = No content order defined
1 = Content order is enabled
2 = Custom content order is not allowed

See

IFolderContent::isContentCustomOrderAllowed()
IFolderContent::contentEnableOrder()

Returns

integer The content custom order value

Overrides

MatthiasWeb\RealMediaLibrary\order\Sortable::getContentCustomOrder
public
# getTypeName( string $default = null )

Get the type name for this folder. For example: Folder, Collection, Gallery, Unorganized.

Get the type name for this folder. For example: Folder, Collection, Gallery, Unorganized.

Parameters

$default
The default (if null "Folder" is used as default)

Since

3.3.1

See

Filter RML/Folder/Type/Name

Returns

string

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::getTypeName
public
# getTypeDescription( string $default = null )

Get the type description for this folder.

Get the type description for this folder.

Parameters

$default
The default (if null folder description is used as default)

Since

3.3.1

See

Filter RML/Folder/Type/Description

Returns

string

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::getTypeDescription
public static
# getInstance( )

Methods inherited from MatthiasWeb\RealMediaLibrary\order\Sortable

contentDeleteOrder(), contentEnableOrder(), contentIndex(), contentOrder(), contentReindex(), contentRestoreOldCustomNr(), delete_all_order(), folder_insert_anyParentHasMetadata(), folder_insert_anyParentHasMetadata_orderAutomatically(), getAttachmentNextTo(), getContentAggregationNr(), getContentNrOf(), getContentOldCustomNrCount(), getContentOrderNumbers(), isContentCustomOrderAllowed(), item_move_finished(), mla_media_modal_query_final_terms(), posts_clauses()

Methods inherited from MatthiasWeb\RealMediaLibrary\folder\Creatable

addChildren(), getMaxOrder(), getRowData(), insert(), isValidName(), read(), reindexChildrens(), relocate(), singleCheckInsert(), singleCheckInsertPermissions(), updateThisAndChildrensAbsolutePath(), xread()

Methods inherited from MatthiasWeb\RealMediaLibrary\folder\BaseFolder

anyChildrenHas(), anyChildrenHasMetadata(), anyParentHas(), anyParentHasMetadata(), getAllParents(), getId(), getName(), getOrder(), getOwner(), getParent(), getPath(), getPlain(), getRestrictions(), getRestrictionsCount(), hasChildren(), is(), isRestrictFor(), isValidChildrenType()

Methods inherited from MatthiasWeb\RealMediaLibrary\base\Base

debug(), getCore(), getTableName()

Properties summary

Properties inherited from MatthiasWeb\RealMediaLibrary\folder\BaseFolder

$absolutePath, $children, $cnt, $contentCustomOrder, $id, $name, $order, $orderNumbers, $parent, $restrictions, $restrictionsCount, $row, $slug, $systemReservedFolders

API documentation generated by ApiGen