diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-13 15:57:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-01-13 15:57:49 +0100 |
commit | e706cf6c06a0111f9ec5db65e46f0fcc9261b456 (patch) | |
tree | d7e28ad1cf7eac8023d6aeb4c064b0b9fcb68fe1 /lib | |
parent | 82762bb4627364241c69a8b39b1d7840a1d71614 (diff) | |
download | nextcloud-server-e706cf6c06a0111f9ec5db65e46f0fcc9261b456.tar.gz nextcloud-server-e706cf6c06a0111f9ec5db65e46f0fcc9261b456.zip |
add Support for passing a FileInfo instance to View->putFileInfo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/fileinfo.php | 4 | ||||
-rw-r--r-- | lib/private/files/view.php | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index 8e9b6a8b72c..b80873d1d00 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -146,4 +146,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess, \JsonSerializable { public function getType() { return $this->data['type']; } + + public function getData(){ + return $this->data; + } } diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 39c2ffed93d..b5870279664 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -963,12 +963,15 @@ class View { * change file metadata * * @param string $path - * @param array $data + * @param array | \OCP\Files\FileInfo $data * @return int * * returns the fileid of the updated file */ public function putFileInfo($path, $data) { + if ($data instanceof FileInfo) { + $data = $data->getData(); + } $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); /** * @var \OC\Files\Storage\Storage $storage |