[TASK] Add API to retrieve the parent folder of a resource 24/26724/7
authorSteffen Ritter <info@rs-websystems.de>
Thu, 9 Jan 2014 15:52:47 +0000 (16:52 +0100)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 30 Jan 2014 18:15:34 +0000 (19:15 +0100)
commita8c5479803eec44326b4a07bb2270aecaaf29c20
treead484f8d9f13bb9e8453f90df21d7ccfd9ba0e08
parent3ac80662f3cd00efc0a99357618de8c54f2f64c2
[TASK] Add API to retrieve the parent folder of a resource

Currently if some code needs the parent directory or folder
object of some files or folders it either needs to query the
storage object for the identifier of the parent folder and then
create the folder object manually or needs to fiddle around with
the identifier manually, assuming that all identifiers are a
representation of a hierarchical path as it is for the local
driver.

The latter not only will fail for all storages having non-path
identifiers it is more overhead to create the folder objects
manually anyhow.

This patch adds "getParentFolder" to the ResourceInterface and
implements the method in AbstractFile and Folder as well as it
replaces the manual resolval in the file list module.

Releases: 6.2
Resolves: #54226
Change-Id: I651d62340186dd9ac57277b498f8f98ee160dfd2
Reviewed-on: https://review.typo3.org/26724
Reviewed-by: Alexander Opitz
Reviewed-by: Marcin SÄ…gol
Reviewed-by: Sebastian Fischer
Tested-by: Sebastian Fischer
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/core/Classes/Resource/AbstractFile.php
typo3/sysext/core/Classes/Resource/Folder.php
typo3/sysext/core/Classes/Resource/ResourceInterface.php
typo3/sysext/core/Tests/Unit/Resource/AbstractFileTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Resource/FolderTest.php
typo3/sysext/filelist/Classes/FileList.php