mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
check if the folder set by setRootFolderID() actually exists
This commit is contained in:
parent
ffd5cd9a7b
commit
0cd4c9b727
|
@ -527,13 +527,23 @@ class SeedDMS_Core_DMS {
|
|||
|
||||
/**
|
||||
* Set id of root folder
|
||||
*
|
||||
* This function must be called right after creating an instance of
|
||||
* {@link SeedDMS_Core_DMS}
|
||||
*
|
||||
* The new root folder id will only be set if the folder actually
|
||||
* exists. In that case the old root folder id will be returned.
|
||||
* If it does not exists, the method will return false;
|
||||
* @param integer $id id of root folder
|
||||
* @return boolean/int old root folder id if new root folder exists, otherwise false
|
||||
*/
|
||||
function setRootFolderID($id) { /* {{{ */
|
||||
$this->rootFolderID = $id;
|
||||
if($this->getFolder($id)) {
|
||||
$oldid = $this->rootFolderID;
|
||||
$this->rootFolderID = $id;
|
||||
return $oldid;
|
||||
}
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user