SiteDrive Folders API
The SiteDrive Folders API offers a way to interact with folders inside a drive.
sitedrive_folder
This offers a way to grab a folder by it's ID.
Arguments
$id |
The ID of the folder from the SiteDrive table |
Returns
Associative Array
of a folder. It will throw an error if a folder does not exist with this ID.
sitedrive_folder_by_drive_and_name
This will grab a folder by the drive ID and the folder name. It is commonly used when trying to grab a folder from another site.
Arguments
$driveId |
The ID of the drive from the SiteDrive table |
$name |
The name of the folder |
Returns
Associative Array
of a folder. It will return null if this does not exist.
sitedrive_folder_name_valid
This is a check that will return true or false if the folder name provided is valid for the SiteDrive system.
Arguments
$name |
The name of the folder |
Returns
bool
if the folder name is valid.
sitedrive_folder_create
Create a folder based on the data provided.
Arguments
$folderInsert |
A file array. Requires value drive_id and name |
Returns
Associative Array
of the created folder. It will throw an error it failed to insert a database row.
sitedrive_folder_update
Update a folder based on ID.
Arguments
$id |
ID of the folder to change |
$folderInsert |
A file array. Can change everything, but the ID |
sitedrive_folder_delete
Delete a folder by ID. This will also delete all file entries in this folder.
Arguments
$id |
ID of the folder to delete |