Documentation

Util
in package
Uses UtilsProvider

Util functionality for Real Media Library.

Table of Contents

Properties

$me  : mixed

Methods

buildTree()  : array<string|int, mixed>
Build a tree from an array.
clearTree()  : mixed
Clears an array of a tree of the parent and id values.
createSQLForAllChildren()  : mixed
createSQLForAllParents()  : mixed
doActionAnyParentHas()  : mixed
See action RML/$action/AnyParentHasMeta.
esc_sql_name()  : string
Escape a SQL name with quotes.
fixIsShortcutInPosts()  : mixed
Fixing the missing isShortcut parameter in wp_realmedialibrary_posts when SC is given in the guid.
getInstance()  : Util
Get instance.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
group_by()  : array<string|int, mixed>
Group an array by key.
query()  : mixed
Query multiple sql statements.
resetAllSlugsAndAbsolutePathes()  : mixed
Allows to reset all names with slugs and absolute path.
resetAllSlugsAndAbsolutePathesTable()  : mixed
__construct()  : mixed
C'tor.

Properties

$me

private static mixed $me = null

Methods

buildTree()

Build a tree from an array.

public buildTree(array<string|int, mixed> &$elements[, int $parentId = -1 ][, string $keyParent = 'parent' ][, string $key = 'id' ][, string $keyChildren = 'children' ]) : array<string|int, mixed>
Parameters
$elements : array<string|int, mixed>
$parentId : int = -1
$keyParent : string = 'parent'
$key : string = 'id'
$keyChildren : string = 'children'
Tags
see
https://stackoverflow.com/questions/8840319/build-a-tree-from-a-flat-array-in-php
Return values
array<string|int, mixed>

clearTree()

Clears an array of a tree of the parent and id values.

public clearTree(array<string|int, mixed> &$tree[, array<string|int, string> $clear = [] ][, string $keyChildren = 'children' ]) : mixed
Parameters
$tree : array<string|int, mixed>

The result of this::buildTree

$clear : array<string|int, string> = []
$keyChildren : string = 'children'

createSQLForAllChildren()

public createSQLForAllChildren(mixed $folder[, mixed $includeSelf = false ][, mixed $options = null ][, mixed $type = null ]) : mixed
Parameters
$folder : mixed
$includeSelf : mixed = false
$options : mixed = null
$type : mixed = null

createSQLForAllParents()

public createSQLForAllParents(mixed $folder[, mixed $includeSelf = false ][, mixed $until = null ][, mixed $options = null ]) : mixed
Parameters
$folder : mixed
$includeSelf : mixed = false
$until : mixed = null
$options : mixed = null

doActionAnyParentHas()

See action RML/$action/AnyParentHasMeta.

public doActionAnyParentHas(IFolder $folder, string $action[, array<string|int, mixed> $args = null ]) : mixed
Parameters
$folder : IFolder

The IFolder object

$action : string

Available action

$args : array<string|int, mixed> = null

The referenced arguments

esc_sql_name()

Escape a SQL name with quotes.

public esc_sql_name(string $name) : string
Parameters
$name : string
Return values
string

fixIsShortcutInPosts()

Fixing the missing isShortcut parameter in wp_realmedialibrary_posts when SC is given in the guid.

public fixIsShortcutInPosts() : mixed

getInstance()

Get instance.

public static getInstance() : Util
Return values
Util

getPluginConstantPrefix()

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

group_by()

Group an array by key.

public group_by(array<string|int, mixed> $array, string $key) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$key : string
Return values
array<string|int, mixed>

query()

Query multiple sql statements.

public query() : mixed

resetAllSlugsAndAbsolutePathes()

Allows to reset all names with slugs and absolute path.

public resetAllSlugsAndAbsolutePathes([callable $remap = null ]) : mixed
Parameters
$remap : callable = null

resetAllSlugsAndAbsolutePathesTable()

public resetAllSlugsAndAbsolutePathesTable() : mixed

__construct()

C'tor.

private __construct() : mixed

        
On this page

Search results