$cachedContentOrders
$cachedContentOrders :
This class creates a root object. (Type 4) See parent classes / interfaces for better documentation.
A new folder type MUST have the implementation with class FOLDERTYPE extends order\Sortable because every folder can also be sortable!
__construct()
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
anyParentHas(string $column,mixed $value = null,string $valueFormat = '%s',boolean $includeSelf = false,integer $until = null): array
Get all parents which meets a given column value or column value is not empty.
string | $column | The column name for the wp_realmedialibrary SQL table. "slug", "name", "absolutePath", ... This string is not escaped when you pass it through this function |
mixed | $value | The value the column should have |
string | $valueFormat | The value format for $value ($wpdb->prepare) This string is not escaped when you pass it through this function |
boolean | $includeSelf | Set true to add self to list |
integer | $until | The highest allowed folder id. If null _wp_rml_root() is used |
folderId => columnValue, first id is the first found parent
anyParentHasMetadata(string $meta_key,mixed $meta_value = null,string $valueFormat = '%s',boolean $includeSelf = false,integer $until = null): array
Get all parents which meets a given meta key value or meta key value is not empty.
string | $meta_key | The meta key name for the wp_realmedialibrary_meta SQL table. This string is not escaped when you pass it through this function |
mixed | $meta_value | The value the meta key should have |
string | $valueFormat | The value format for $value ($wpdb->prepare) This string is not escaped when you pass it through this function |
boolean | $includeSelf | Set true to add self to list |
integer | $until | The highest allowed folder id. If null _wp_rml_root() is used |
Array with keys: id (meta_id), folderId, value (meta_value), first id is the first found parent
anyChildrenHas(string $column,mixed $value = null,string $valueFormat = '%s',boolean $includeSelf = false): array
Get all children which meets a given column value or column value is not empty.
string | $column | The column name for the wp_realmedialibrary SQL table. "slug", "name", "absolutePath", ... This string is not escaped when you pass it through this function |
mixed | $value | The value the column should have |
string | $valueFormat | The value format for $value ($wpdb->prepare) This string is not escaped when you pass it through this function |
boolean | $includeSelf | Set true to add self to list |
folderId => columnValue, first id is the first found child
anyChildrenHasMetadata(string $meta_key,mixed $meta_value = null,string $valueFormat = '%s',boolean $includeSelf = false): array
Get all chilren which meets a given meta key value or meta key value is not empty.
string | $meta_key | The meta key name for the wp_realmedialibrary_meta SQL table. This string is not escaped when you pass it through this function |
mixed | $meta_value | The value the meta key should have |
string | $valueFormat | The value format for $value ($wpdb->prepare) This string is not escaped when you pass it through this function |
boolean | $includeSelf | Set true to add self to list |
Array with keys: id (meta_id), folderId, value (meta_value), first id is the first found child
hasChildren(string $name,boolean $returnObject = false): boolean
Checks if this folder has a children with a given name.
string | $name | Name of folder |
boolean | $returnObject | If set to true and a children with this name is found, then return the object for this folder |
getAllParents(integer $until = null,integer $colIdx): array<mixed,integer>
Get all parents of this folder.
integer | $until | The highest allowed folder id. If null _wp_rml_root() is used |
integer | $colIdx | The index returning for the wp_rml_create_all_parents_sql() query |
Folder ids, first id is the first parent
getPath(string $implode = '/',callable $map = 'htmlentities',callable $filter = null): string
Creates a absolute path without slugging' the names.
// Get valid physical folder name
$folder->getPath("/", "_wp_rml_sanitize_filename");
string | $implode | Delimiter for the folder names |
callable | $map | Map the names with this function. Pass null to skip this map function |
callable | $filter | Filter folders |
htmlentitied path
getInstance(): \MatthiasWeb\RealMediaLibrary\folder\Root
Get instance.