\MatthiasWeb\RealMediaLibraryUtil

Util functionality for Real Media Library.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
query()
doActionAnyParentHas()
buildTree()
clearTree()
group_by()
fixIsShortcutInPosts()
resetAllSlugsAndAbsolutePathes()
resetAllSlugsAndAbsolutePathesTable()
createSQLForAllParents()
createSQLForAllChildren()
esc_sql_name()
getInstance()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$me
N/A

Properties

$me

$me :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

query()

query()

Query multiple sql statements.

doActionAnyParentHas()

doActionAnyParentHas(\MatthiasWeb\RealMediaLibrary\api\IFolder  $folder,string  $action,array<mixed,mixed>  $args = null)

See action RML/$action/AnyParentHasMeta.

Parameters

\MatthiasWeb\RealMediaLibrary\api\IFolder $folder

The IFolder object

string $action

Available action

array<mixed,mixed> $args

The referenced arguments

buildTree()

buildTree(array<mixed,mixed>  $elements,integer  $parentId = -1,string  $keyParent = 'parent',string  $key = 'id',string  $keyChildren = 'children'): array<mixed,mixed>

Build a tree from an array.

Parameters

array<mixed,mixed> $elements
integer $parentId
string $keyParent
string $key
string $keyChildren

Returns

array<mixed,mixed>

clearTree()

clearTree(array  $tree,array<mixed,string>  $clear = array(),string  $keyChildren = 'children')

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

Parameters

array $tree

The result of this::buildTree

array<mixed,string> $clear
string $keyChildren

group_by()

group_by(array  $array,string  $key): array

Group an array by key.

Parameters

array $array
string $key

Returns

array

fixIsShortcutInPosts()

fixIsShortcutInPosts()

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

resetAllSlugsAndAbsolutePathes()

resetAllSlugsAndAbsolutePathes(callable  $remap = null)

Allows to reset all names with slugs and absolute path.

Parameters

callable $remap

resetAllSlugsAndAbsolutePathesTable()

resetAllSlugsAndAbsolutePathesTable()

createSQLForAllParents()

createSQLForAllParents(  $folder,  $includeSelf = false,  $until = null,  $options = null)

Parameters

$folder
$includeSelf
$until
$options

createSQLForAllChildren()

createSQLForAllChildren(  $folder,  $includeSelf = false,  $options = null,  $type = null)

Parameters

$folder
$includeSelf
$options
$type

esc_sql_name()

esc_sql_name(string  $name): string

Escape a SQL name with quotes.

Parameters

string $name

Returns

string

__construct()

__construct()

C'tor.