*/
namespace OC\Files\Node;
+use OCP\Constants;
+
/**
* Class LazyFolder
*
/** @var LazyFolder | null */
protected $folder = null;
+ protected array $data;
+
/**
* LazyFolder constructor.
*
* @param \Closure $folderClosure
*/
- public function __construct(\Closure $folderClosure) {
+ public function __construct(\Closure $folderClosure, array $data = []) {
$this->folderClosure = $folderClosure;
+ $this->data = $data;
}
/**
* @inheritDoc
*/
public function getPath() {
+ if (isset($this->data['path'])) {
+ return $this->data['path'];
+ }
return $this->__call(__FUNCTION__, func_get_args());
}
* @inheritDoc
*/
public function getPermissions() {
+ if (isset($this->data['permissions'])) {
+ return $this->data['permissions'];
+ }
return $this->__call(__FUNCTION__, func_get_args());
}
* @inheritDoc
*/
public function isReadable() {
+ if (isset($this->data['permissions'])) {
+ return ($this->data['permissions'] & Constants::PERMISSION_READ) == Constants::PERMISSION_READ;
+ }
return $this->__call(__FUNCTION__, func_get_args());
}
* @inheritDoc
*/
public function isUpdateable() {
+ if (isset($this->data['permissions'])) {
+ return ($this->data['permissions'] & Constants::PERMISSION_UPDATE) == Constants::PERMISSION_UPDATE;
+ }
return $this->__call(__FUNCTION__, func_get_args());
}
* @inheritDoc
*/
public function isDeletable() {
+ if (isset($this->data['permissions'])) {
+ return ($this->data['permissions'] & Constants::PERMISSION_DELETE) == Constants::PERMISSION_DELETE;
+ }
return $this->__call(__FUNCTION__, func_get_args());
}
* @inheritDoc
*/
public function isShareable() {
+ if (isset($this->data['permissions'])) {
+ return ($this->data['permissions'] & Constants::PERMISSION_SHARE) == Constants::PERMISSION_SHARE;
+ }
return $this->__call(__FUNCTION__, func_get_args());
}