ar\store\files

This module contains methods to access files stores in Ariadne objects. Any object type in Ariadne can store multiple files. The pfile and pphoto classes only add some usefull methods and user interface templates. Using the ar\files module you can create, update, read and delete files for any object type.

methods

(void)lsList all files stored in the current ariadne object.
(object)getGet a specific file stored in this object.
(bool)saveSave a file in this object.
(bool)deleteDelete a file from this object.
(bool)touchUpdate timestamp of existing file in this object.
(bool)existsReturns true if the named file exists in this object.

ls

(array) ar('store/files')->ls( $nls = null )

Returns a list of files stored in the current object, with the given language.

get

(ar_content_filesFile) ar('store/files')->get( $name, $nls = null )

Returns the file object with the given name and language, or returns a File Not Found error ( code 404 ). The file object implements the ar_content_filesFile interface.

save

(bool) ar('store/files')->save( $name, $contents, $nls = null )

Saves the given string contents to a file with the given name and language. This will overwrite any previous file with the same name and language.

delete

(bool) ar('store/files')->delete( $name, $nls = null )

Removes the file with the given name and language from this object. Returns true on success, false on failure.

touch

(bool) ar('store/files')->touch( $name, $time = null, $nls = null )

Updates the last changed time for the file with the given name and language to the given timestamp. If the file doesn't exist it will not create the file and return false. Otherwise it will return true.

exists

(bool) ar('store/files')->exists( $name, $nls = null )

Returns true if the file with the given name and language exists for this object.