wp_rml_create_all_children_sql()
wp_rml_create_all_children_sql(\MatthiasWeb\RealMediaLibrary\api\IFolder|integer $folder,boolean $includeSelf = false,array $options = null): string|boolean
Returns a SQL query to get all children for a folder id.
The first result for this SQL statement is the first children and so on...
$options parameters:
"fields" => (string) SELECT fields (default: "rmldata.*"),
"join" => (string) JOIN statement (default: ""),
"where" => (string) Replace WHERE statement, it is preferred to use afterWhere (default: '1=1 ' . ($includeSelf === true ? "" : $wpdb->prepare(" AND rmldata.id != %d", $folderId))),
"afterWhere" => (string) Additional WHERE statement to the above WHERE (default: ""),
"orderby" => (string) ORDER BY statement (default: "rmldata.parent, rmldata.ord"),
"limit" => (string) LIMIT statement (default: "")
Note: Not all database systems do support this kind of SQL query. You have to use the
wp_rml_all_children_sql_supported() API function to check if it is supported.
Parameters
\MatthiasWeb\RealMediaLibrary\api\IFolder|integer |
$folder |
The folder object or folder id |
boolean |
$includeSelf |
Set true to include self (passed $folder) |
array |
$options |
Additional options for the SQL query, see above |
Returns
string|boolean
—SQL query or false if something went wrong