mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
run decorators, new method isType(), use $this instead of self::
This commit is contained in:
parent
f9eabdb252
commit
99238a34f4
|
@ -129,6 +129,15 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
$this->_notifyList = array();
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check if this object is of type 'folder'.
|
||||
*
|
||||
* @param string $type type of object
|
||||
*/
|
||||
public function isType($type) { /* {{{ */
|
||||
return $type == 'folder';
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return an array of database fields which used for searching
|
||||
* a term entered in the database search form
|
||||
|
@ -191,9 +200,27 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
/** @var SeedDMS_Core_Folder $folder */
|
||||
$folder = new $classname($resArr["id"], $resArr["name"], $resArr["parent"], $resArr["comment"], $resArr["date"], $resArr["owner"], $resArr["inheritAccess"], $resArr["defaultAccess"], $resArr["sequence"]);
|
||||
$folder->setDMS($dms);
|
||||
$folder = $folder->applyDecorators();
|
||||
return $folder;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Apply decorators
|
||||
*
|
||||
* @return object final object after all decorators has been applied
|
||||
*/
|
||||
function applyDecorators() { /* {{{ */
|
||||
if($decorators = $this->_dms->getDecorators('folder')) {
|
||||
$s = $this;
|
||||
foreach($decorators as $decorator) {
|
||||
$s = new $decorator($s);
|
||||
}
|
||||
return $s;
|
||||
} else {
|
||||
return $this;
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get the name of the folder.
|
||||
*
|
||||
|
@ -448,7 +475,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
$this->_defaultAccess = $mode;
|
||||
|
||||
if(!$noclean)
|
||||
self::cleanNotifyList();
|
||||
$this->cleanNotifyList();
|
||||
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
@ -481,7 +508,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
$this->_inheritAccess = $inheritAccess;
|
||||
|
||||
if(!$noclean)
|
||||
self::cleanNotifyList();
|
||||
$this->cleanNotifyList();
|
||||
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
@ -1224,7 +1251,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
unset($this->_accessList);
|
||||
|
||||
if(!$noclean)
|
||||
self::cleanNotifyList();
|
||||
$this->cleanNotifyList();
|
||||
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user