$id
$id :
Abstract base class for folders. It handles the available fields and getters / setters.
The class is completely documented in the implemented interface.
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
getSlug(boolean $force = false,boolean $fromSetName = false): string
Returns a sanitized title for the folder. If the slug is empty or forced to, it will be updated in the database, too.
boolean | $force | Forces to regenerate the slug |
boolean | $fromSetName | For internal usage only |
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
getAbsolutePath(boolean $force = false,boolean $fromSetName = false): string
Creates a absolute path. If the absolute path is empty or forced to, it will be updated in the database, too.
boolean | $force | Forces to regenerate the absolute path |
boolean | $fromSetName | For internal usage only |
getChildren(): \MatthiasWeb\RealMediaLibrary\api\IFolder
Get children of this folder.