mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
add method isDescendant()
This commit is contained in:
parent
d1100501fc
commit
536067200e
|
@ -519,6 +519,24 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check, if this document is below of a given folder
|
||||
*
|
||||
* @param object $folder parent folder
|
||||
* @return boolean true if folder is a subfolder
|
||||
*/
|
||||
function isDescendant($folder) { /* {{{ */
|
||||
/* First check if the parent folder is folder looking for */
|
||||
if ($this->getFolder()->getID() == $folder->getID())
|
||||
return true;
|
||||
/* Second, check for the parent folder of this document to be
|
||||
* below the given folder
|
||||
*/
|
||||
if($this->getFolder()->isDescendant($folder))
|
||||
return true;
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return the parent folder of the document
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user