class UvwdocsModelfile extends JModelAdmin


Located at : UKNOWVA_ROOT/components/com_uvwdocs/models/file.php

Uvwdocs model.

Properties

$_errormsg

Methods

__construct(array $config)

Returns a reference to the a Table object, always creating it.

string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
static array
addIncludePath(mixed $path = '', string $prefix = '')

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

from JModel
static void
addTablePath(mixed $path)

Adds to the stack of model table paths in LIFO order.

from JModel
static mixed
getInstance(string $type, string $prefix = '', array $config = array())

Returns a Model object, always creating it

from JModel
getDbo()

Method to get the database connector object

from JModel
string
getName()

Method to get the model name

from JModel
object
getState(string $property = null, mixed $default = null)

Method to get model state variables

from JModel
getTable($type = 'File', string $prefix = 'UvwdocsTable', $config = array())

Method to get a table object, load it if necessary.

void
setDbo(object $db)

Method to set the database connector object

from JModel
mixed
setState(string $property, mixed $value = null)

Method to set model state variables

from JModel
boolean
checkin(mixed $pks = array())

Method override to check-in a record or an array of record

boolean
checkout(integer $pk = null)

Method override to check-out a record.

mixed
getForm(array $data = array(), boolean $loadData = true)

Method to get the record form.

mixed
validate(object $form, array $data, string $group = null)

Method to validate the form data.

boolean
batch(array $commands, array $pks)

Method to perform batch operations on an item or a set of items.

boolean
delete(array $pks)

Method to delete one or more records.

mixed
getItem(integer $pk = null)

Method to get a single record.

boolean
publish(array $pks, integer $value = 1)

Method to change the published state of one or more records.

mixed
reorder(integer $pks, integer $delta)

Method to adjust the ordering of a row.

boolean
save(array $data, bool $returnObject = false)

Method to save the form data.

mixed
saveorder(array $pks = null, integer $order = null)

Saves the manually set order of records.

boolean
store(string $data)

stores files in folder

boolean|mixed
addAttachment(string $uniqueid, mixed|int $file_id)

adding attachment

boolean|mixed|mixed|boolean
getData(int $id)

this will also give breadcrump if true

boolean
moveFile(int $id, string $from, number $to)

moves folder

boolean|string
deleteFile(int $id, string $returnmsg = true)

deletes the file

boolean|string
permanentlyDeleteFile(int $id, string $returnmsg = true)

permanently deletes folder

boolean|string
restoreFile(int $id, string $returnmsg = true)

restore deleted file

boolean
checkFileName(string $title, number $catid, int $id = Null, number $publish = 1)

checks file name

mixed|NULL
findFileInFolder(string $title, number $catid, int $id = Null, number $publish = 1)

similar to above function but just returns the file_id

boolean
hasAccessToFile(int $id, int $userid, string $type = 'view')

checks if has access to file to a particular user

boolean
hasEditAccessToFile(int $id, int $userid)

checks if has edit access to file for particular user

boolean
hasDeleteAccessToFile(int $id, int $userid)

checks if the user has delete access to the file

boolean
hasVersionsAccessToFile(int $id, int $userid)

checks if the user has edit access to version file

boolean
addLog(int $id, string $log, string $time_stamp = null)

adds log regarding the files

mixed|NULL|unknown[]|mixed[]
getLog(int $id)

get logs

string|string|mixed|NULL
getFileIcon(string $type, string $default = 'file_icon.png')

gets file icon

incrementHits(int $id, string $type = null)

gets the increment hits of the file

boolean
deleteFileLocation(int $id)

deletes file location

downloadFile(int $id)

downloads the file

downloadVersion(int $id)

downloads the file version

embedFile(int $id)

embeds the file in html so you can see in the browser instead of download link

void|boolean
downloadFileFromLink(int|mixed $id, int $user_id, string $token)

Downloads file from link

boolean
isDownloadAllowed(int $id, int $user_id, string $token)

checks if download is allowed

boolean
setUpCron(int $id, string $type = 'file')

sets up the cron

getUserMaxFileSize()

calls UvwdocsHelper::getUserMaxFileSize() function

getUserFileTypes()

calls UvwdocsHelper::getUserFileTypes() function

boolean
changeDownloadToken(int $id)

change download token

boolean|string
getPublicDownloadLink(int $id, int $user_id = null)

gets the public download link

boolean|string
getDownloadLink(int $id)

gets download link

boolean|string
getEmbedLink(int $id)

gets the link with html tag

string
getVersionDownloadLink(int $file_id, string $version_id)

gets the version of the file

gets
getDetailsLink(int $id)

gets the detail link

mixed|NULL|unknown[]|mixed[]
getAttachments(int|string $uniqueid, int $currentuserid = null)

gets attachments

boolean|mixed|NULL
getAttachmentInfo(int $id)

gets the attachment info

string|mixed
getAttachmentHTML(int $file, string $displaytemplate, int $userid = null)

get attachment HTML output

boolean
createVersion(int $file, string $move = false)

copies the current file to another location with a new version

boolean
getAllVersions(int $file_id)

gets all the versions of the file

boolean|JTable
getVersionDetails(int $id)

get the version details of the file

boolean
deleteFileVersion(int $version_id)

deletes the version of the file

boolean
pushFile(string $filepath, array $options = array(), int $userid = null, string $self_destroy = true, string $replace_existing = false)

create a file from a location already present on the server This function will move the file to uknowva docs system and also delete the file if the flag of delete file is not set

Details

at line 41
JObject __construct(array $config)

Returns a reference to the a Table object, always creating it.

Parameters

array $config An array of configuration options (name, state, dbo, tablepath, ignorerequest).

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

in JModel at line 84
static array addIncludePath(mixed $path = '', string $prefix = '')

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

Parameters

mixed $path A path or array[sting] of paths to search.
string $prefix A prefix for models.

Return Value

array An array with directory elements. If prefix is equal to '', all directories are returned.

in JModel at line 123
static void addTablePath(mixed $path)

Adds to the stack of model table paths in LIFO order.

Parameters

mixed $path The directory as a string or directories as an array to add.

Return Value

void

in JModel at line 161
static mixed getInstance(string $type, string $prefix = '', array $config = array())

Returns a Model object, always creating it

Parameters

string $type The model type to instantiate
string $prefix Prefix for the model class name. Optional.
array $config Configuration array for model. Optional.

Return Value

mixed A model object or false on failure

in JModel at line 327
JDatabase getDbo()

Method to get the database connector object

Return Value

JDatabase JDatabase connector object

in JModel at line 341
string getName()

Method to get the model name

The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor

Return Value

string The name of the model

in JModel at line 365
object getState(string $property = null, mixed $default = null)

Method to get model state variables

Parameters

string $property Optional parameter name
mixed $default Optional default value

Return Value

object The property where specified, the state object where omitted

at line 51
JTable getTable($type = 'File', string $prefix = 'UvwdocsTable', $config = array())

Method to get a table object, load it if necessary.

Parameters

$type
string $prefix The class prefix. Optional.
$config

Return Value

JTable A JTable object

See also

JModel::getTable()

in JModel at line 427
void setDbo(object $db)

Method to set the database connector object

Parameters

object $db &$db A JDatabase based object

Return Value

void

in JModel at line 441
mixed setState(string $property, mixed $value = null)

Method to set model state variables

Parameters

string $property The name of the property.
mixed $value The value of the property to set or null.

Return Value

mixed The previous value of the property or null if not set.

in JModelAdmin at line 520
boolean checkin(mixed $pks = array())

Method override to check-in a record or an array of record

Parameters

mixed $pks The ID of the primary key or an array of IDs

Return Value

boolean False on failure or error, true otherwise.

in JModelAdmin at line 562
boolean checkout(integer $pk = null)

Method override to check-out a record.

Parameters

integer $pk The numeric id of the primary key.

Return Value

boolean False on failure or error, true otherwise.

at line 65
mixed getForm(array $data = array(), boolean $loadData = true)

Method to get the record form.

Parameters

array $data Data for the form.
boolean $loadData True if the form is to load its own data (default case), false if not.

Return Value

mixed A JForm object on success, false on failure

in JModelForm at line 240
mixed validate(object $form, array $data, string $group = null)

Method to validate the form data.

Parameters

object $form The form to validate against.
array $data The data to validate.
string $group The name of the field group to validate.

Return Value

mixed Array of filtered data if valid, false otherwise.

See also

JFormRule
JFilterInput

in JModelAdmin at line 132
boolean batch(array $commands, array $pks)

Method to perform batch operations on an item or a set of items.

Parameters

array $commands An array of commands to perform.
array $pks An array of item ids.

Return Value

boolean Returns true on success, false on failure.

in JModelAdmin at line 578
boolean delete(array $pks)

Method to delete one or more records.

Parameters

array $pks An array of record primary keys.

Return Value

boolean True if successful, false if an error occurs.

at line 107
mixed getItem(integer $pk = null)

Method to get a single record.

Parameters

integer $pk The id of the primary key.

Return Value

mixed Object on success, false on failure.

in JModelAdmin at line 766
boolean publish(array $pks, integer $value = 1)

Method to change the published state of one or more records.

Parameters

array $pks A list of the primary keys to change.
integer $value The value of the published state.

Return Value

boolean True on success.

in JModelAdmin at line 825
mixed reorder(integer $pks, integer $delta)

Method to adjust the ordering of a row.

Returns NULL if the user did not have edit privileges for any of the selected primary keys.

Parameters

integer $pks The ID of the primary key to move.
integer $delta Increment, usually +1 or -1

Return Value

mixed False on failure or error, true on success, null if the $pk is empty (no items selected).

in JModelAdmin at line 887
boolean save(array $data, bool $returnObject = false)

Method to save the form data.

Parameters

array $data The form data.
bool $returnObject If set to true, then the table object shall be returned, this was added in 2.5.1 onwards

Return Value

boolean True on success, False on error.

in JModelAdmin at line 969
mixed saveorder(array $pks = null, integer $order = null)

Saves the manually set order of records.

Parameters

array $pks An array of primary key ids.
integer $order +1 or -1

Return Value

mixed

at line 142
boolean store(string $data)

stores files in folder

Parameters

string $data file

Return Value

boolean true success from the language string or else som error message from the language file

at line 240
boolean|mixed addAttachment(string $uniqueid, mixed|int $file_id)

adding attachment

Parameters

string $uniqueid unique id
mixed|int $file_id file id

Return Value

boolean|mixed stores the value and shows it

at line 258
boolean|mixed|mixed|boolean getData(int $id)

this will also give breadcrump if true

Parameters

int $id file id

Return Value

boolean|mixed|mixed|boolean returns the row of the given above id

at line 285
boolean moveFile(int $id, string $from, number $to)

moves folder

Parameters

int $id folder id
string $from from where to move the file
number $to where to move the file,0 is for root, from shall be used when adding to logs

Return Value

boolean returns true is succeed or else false

at line 318
boolean|string deleteFile(int $id, string $returnmsg = true)

deletes the file

Parameters

int $id file id
string $returnmsg returns the message and not a boolean if $returnmsg=false

Return Value

boolean|string returns success from the language file as defined or else error from the language fike

at line 346
boolean|string permanentlyDeleteFile(int $id, string $returnmsg = true)

permanently deletes folder

Parameters

int $id folder id
string $returnmsg returns the message and not a boolean if $returnmsg=false

Return Value

boolean|string returns succeed from the language file or else error from the language file as defined

at line 398
boolean|string restoreFile(int $id, string $returnmsg = true)

restore deleted file

Parameters

int $id file id
string $returnmsg returns the message and not a boolean if $returnmsg=false

Return Value

boolean|string return succeed from language file as defined in the language file or else error from the language file as defined

at line 434
boolean checkFileName(string $title, number $catid, int $id = Null, number $publish = 1)

checks file name

Parameters

string $title title of the file
number $catid category id
int $id row id
number $publish publish number

Return Value

boolean returns false if the File exists or else true

at line 463
mixed|NULL findFileInFolder(string $title, number $catid, int $id = Null, number $publish = 1)

similar to above function but just returns the file_id

Parameters

string $title title of the file
number $catid category id
int $id file id
number $publish publish number

Return Value

mixed|NULL returns the file id or else false if failed

at line 481
boolean hasAccessToFile(int $id, int $userid, string $type = 'view')

checks if has access to file to a particular user

Parameters

int $id file id
int $userid user id
string $type $type can be view,edit,upload,delete view access, default = 'view'

Return Value

boolean returns true if have access or else false

at line 539
boolean hasEditAccessToFile(int $id, int $userid)

checks if has edit access to file for particular user

Parameters

int $id file id
int $userid user id

Return Value

boolean returns true if have access or else false

at line 554
boolean hasDeleteAccessToFile(int $id, int $userid)

checks if the user has delete access to the file

Parameters

int $id file id
int $userid user id

Return Value

boolean returns true if have access or else false

at line 569
boolean hasVersionsAccessToFile(int $id, int $userid)

checks if the user has edit access to version file

Parameters

int $id file ids
int $userid user id

Return Value

boolean returns true if have access or else false

at line 586
boolean addLog(int $id, string $log, string $time_stamp = null)

adds log regarding the files

Parameters

int $id file id
string $log log which you want to add
string $time_stamp timestamp or else gets current time automatically, default = NULL

Return Value

boolean returns true if succeed in saving log or else false

at line 626
mixed|NULL|unknown[]|mixed[] getLog(int $id)

get logs

Parameters

int $id log id to get

Return Value

mixed|NULL|unknown[]|mixed[] returns the log values

at line 641
string|string|mixed|NULL getFileIcon(string $type, string $default = 'file_icon.png')

gets file icon

Parameters

string $type
string $default default = 'file_icon.png'

Return Value

string|string|mixed|NULL

at line 659
incrementHits(int $id, string $type = null)

gets the increment hits of the file

Parameters

int $id file id
string $type pass type = download if downloads hit counter also needs to be incremented

at line 677
boolean deleteFileLocation(int $id)

deletes file location

Parameters

int $id file id

Return Value

boolean returns true if success or false

at line 697
downloadFile(int $id)

downloads the file

Parameters

int $id file id

at line 738
downloadVersion(int $id)

downloads the file version

Parameters

int $id id of the file

at line 774
embedFile(int $id)

embeds the file in html so you can see in the browser instead of download link

Parameters

int $id file id

Downloads file from link

Parameters

int|mixed $id id of the file
int $user_id user id
string $token download token

Return Value

void|boolean passes the values to this function ConvHelper::force_download()

at line 921
boolean isDownloadAllowed(int $id, int $user_id, string $token)

checks if download is allowed

Parameters

int $id file id
int $user_id user id
string $token download token

Return Value

boolean returns returns true if allowed or else false

at line 952
boolean setUpCron(int $id, string $type = 'file')

sets up the cron

Parameters

int $id id is the file id, but if type==folder then id is cat_id
string $type type like view,task, default ='file'

Return Value

boolean returns true if yes or else false

at line 983
getUserMaxFileSize()

calls UvwdocsHelper::getUserMaxFileSize() function

at line 989
getUserFileTypes()

calls UvwdocsHelper::getUserFileTypes() function

at line 1000
boolean changeDownloadToken(int $id)

change download token

Parameters

int $id file id

Return Value

boolean returns true if changed or else false

gets the public download link

Parameters

int $id file id
int $user_id user id default = NULL

Return Value

boolean|string returns the download link

gets download link

Parameters

int $id file id

Return Value

boolean|string returns the download link to the file

gets the link with html tag

Parameters

int $id file id

Return Value

boolean|string returns link if success

gets the version of the file

Parameters

int $file_id file id
string $version_id version id

Return Value

string returns the download link of the file as passed in the version

gets the detail link

Parameters

int $id file id

Return Value

gets to the link to the file

at line 1179
mixed|NULL|unknown[]|mixed[] getAttachments(int|string $uniqueid, int $currentuserid = null)

gets attachments

Parameters

int|string $uniqueid unique id
int $currentuserid user id or else gets it automatically, default = NULL

Return Value

mixed|NULL|unknown[]|mixed[] returns attachment

at line 1203
boolean|mixed|NULL getAttachmentInfo(int $id)

gets the attachment info

Parameters

int $id file id

Return Value

boolean|mixed|NULL returns the info about the id provided or else provides the link to it

at line 1231
string|mixed getAttachmentHTML(int $file, string $displaytemplate, int $userid = null)

get attachment HTML output

Parameters

int $file file id
string $displaytemplate template if any
int $userid user id

Return Value

string|mixed returns the output in HTML output

at line 1304
boolean createVersion(int $file, string $move = false)

copies the current file to another location with a new version

Parameters

int $file can be an object of UVWDocsFile class or id
string $move if move = true, the file shall be moved to versions folder, else it will just be copied

Return Value

boolean returns true if success or else false

at line 1377
boolean getAllVersions(int $file_id)

gets all the versions of the file

Parameters

int $file_id file id

Return Value

boolean returns all the version of the file or else false

at line 1392
boolean|JTable getVersionDetails(int $id)

get the version details of the file

Parameters

int $id file id

Return Value

boolean|JTable gets the version details of the file or else false

at line 1408
boolean deleteFileVersion(int $version_id)

deletes the version of the file

Parameters

int $version_id version id

Return Value

boolean returns true if success or else false

at line 1452
boolean pushFile(string $filepath, array $options = array(), int $userid = null, string $self_destroy = true, string $replace_existing = false)

create a file from a location already present on the server This function will move the file to uknowva docs system and also delete the file if the flag of delete file is not set

Parameters

string $filepath is the physical location of the file
array $options options could have keys like: title catid accesslevel, etc
int $userid user id, default = NULL
string $self_destroy if self_destroy=true, the file located at $filepath will be deleted after copy
string $replace_existing if replace_existing = true, then any existing file with same name will be deleted and the new file be replaced, else the file will be renamed and saved

Return Value

boolean