\ElectronicDelivery_OrderLog
This is an OrderStatusLog for the downloads It shows the download links To make it work, you will have to add files.
When it is first written it creates a folder for the downloads
you can then add files using the AddFiles method.
Synopsis
class ElectronicDelivery_OrderLog
extends OrderStatusLog
{
- // members
- private boolean $debug = false;
- private static array $db = ;
- private static array $many_many = ;
- private static array $summary_fields = ;
- private static array $defaults = ;
- private static Array $searchable_fields = ;
- private static String $singular_name = "Electronic Delivery Details for one Order";
- private static String $plural_name = "Electronic Deliveries Detail for many Orders";
- private static String $default_sort = "\"Created\" DESC";
- private static Int $random_folder_name_character_count = 12;
- private static String $htaccess_content = "";
- private static Array $files_to_be_excluded = ;
- private static string $permissions_on_folder = "";
- private static String $order_dir = '_downloads';
- private integer $loopEscape = 0;
- // methods
- public void populateDefaults()
- public Boolean canDelete()
- public Boolean canCreate()
- public Boolean canEdit()
- public void i18n_singular_name()
- public void i18n_plural_name()
- public void getCMSFields()
- public void AddFiles()
- public Boolean IsExpired()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void deleteFolderIfExpired()
- public void onBeforeDelete()
- protected Array getFilesInFolder()
- protected NULL getOrderDownloadFolder()
- protected NULL getBaseFolder()
- protected String getFolderPermissions()
- protected array getDirectoryContents()
- protected Boolean deleteFolderContents()
Hierarchy
Extends
- OrderStatusLog
Members
private
-
$db
Standard SS variable -
$debug
Use for debugging uses debug::log - $default_sort
—
String
Standard SS var -
$defaults
Standard SS variable - $files_to_be_excluded
—
Array
List of files to be ignored when searching for files in the folder This may allow you to add "hidden" files or ignore other files. - $htaccess_content
—
String
if set to anything except an empty string, an .htaccess file will be added to the download folder with the content of the variable content idea: Options -Indexes (stops directly from listing folders) - $loopEscape
—
int
making sure we dont end up in an infinite loop -
$many_many
Standard SS variable - $order_dir — String
- $permissions_on_folder
—
string
Permissions on download folders if not set, it will use: Config::inst()->get('Filesystem', 'folder_create_mask') - $plural_name
—
String
Standard SS var - $random_folder_name_character_count
—
Int
Size of the folder name (recommended to be at least 5+) - $searchable_fields
—
Array
Standard SS var - $singular_name
—
String
Standard SS var -
$summary_fields
Standard SS variable
Methods
protected
- deleteFolderContents() — remove all the folder contents and remove the folder itself as well... Returns true on success.
- getBaseFolder() — returns the folder in which all the downloads are kept (each order has an individual folder within this base folder) returns location of base folder.
- getDirectoryContents() — get folder contents
- getFilesInFolder() — returns the list of files that are in the current folder
- getFolderPermissions() — returns the permissions for the folder to be created.
- getOrderDownloadFolder() — creates a folder and returns the full folder path if the folder is already created it still returns the folder path, but it does not create the folder.
public
- AddFiles() — Adds the download files to the Log and makes them available for download.
- IsExpired() — checks if the download has expired (i.e. too much time has passed)
- canCreate()
- canDelete()
- canEdit()
- deleteFolderIfExpired()
- getCMSFields()
- i18n_plural_name()
- i18n_singular_name()
- onAfterWrite() — Standard SS method If it has expired, then the folder is deleted...
- onBeforeDelete() — Standard SS method Deletes the files in the download folder, and the actual download folder itself.
- onBeforeWrite() — Standard SS method Creates the folder and files.
- populateDefaults() — Set the default: the files are not ready yet! Standard SS method