[FOLLOW-UP][TASK] Rename FAL driver count methods 33/38533/3
authorMathias Brodala <mbrodala@pagemachine.de>
Wed, 8 Apr 2015 12:36:06 +0000 (14:36 +0200)
committerNicole Cordes <typo3@cordes.co>
Thu, 9 Apr 2015 07:56:26 +0000 (09:56 +0200)
This changes the names of the newly added FAL driver count methods
to be more intuitive.

Since the new API wasn't published yet, this is not a breaking change.

Resolves: #66327
Related: #56746
Releases: master
Change-Id: Ia5732266bada674b64a9d9768dfff98871eb6b13
Reviewed-on: http://review.typo3.org/38533
Reviewed-by: Steffen Müller <typo3@t3node.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Steffen Müller <typo3@t3node.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/core/Classes/Resource/Driver/DriverInterface.php
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php
typo3/sysext/core/Classes/Resource/Folder.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-56746-AddCountMethodsAndSortFunctionalityToFalDrivers.rst
typo3/sysext/filelist/Classes/FileList.php

index 598cb65..2bbbdea 100644 (file)
@@ -438,7 +438,7 @@ interface DriverInterface {
         * @param array   $filenameFilterCallbacks callbacks for filtering the items
         * @return integer Number of files in folder
         */
-       public function getFilesInFolderCount($folderIdentifier, $recursive = FALSE, array $filenameFilterCallbacks = array());
+       public function countFilesInFolder($folderIdentifier, $recursive = FALSE, array $filenameFilterCallbacks = array());
 
        /**
         * Returns the number of folders inside the specified path
@@ -448,6 +448,6 @@ interface DriverInterface {
         * @param array   $folderNameFilterCallbacks callbacks for filtering the items
         * @return integer Number of folders in folder
         */
-       public function getFoldersInFolderCount($folderIdentifier, $recursive = FALSE, array $folderNameFilterCallbacks = array());
+       public function countFoldersInFolder($folderIdentifier, $recursive = FALSE, array $folderNameFilterCallbacks = array());
 
 }
index c60b5e7..6ee7aa7 100644 (file)
@@ -452,7 +452,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver {
         * @param array $filenameFilterCallbacks callbacks for filtering the items
         * @return int Number of files in folder
         */
-       public function getFilesInFolderCount($folderIdentifier, $recursive = FALSE, array $filenameFilterCallbacks = array()) {
+       public function countFilesInFolder($folderIdentifier, $recursive = FALSE, array $filenameFilterCallbacks = array()) {
                return count($this->getFilesInFolder($folderIdentifier, 0, 0, $recursive, $filenameFilterCallbacks));
        }
 
@@ -484,7 +484,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver {
         * @param array   $folderNameFilterCallbacks callbacks for filtering the items
         * @return integer Number of folders in folder
         */
-       public function getFoldersInFolderCount($folderIdentifier, $recursive = FALSE, array $folderNameFilterCallbacks = array()) {
+       public function countFoldersInFolder($folderIdentifier, $recursive = FALSE, array $folderNameFilterCallbacks = array()) {
                return count($this->getFoldersInFolder($folderIdentifier, 0, 0, $recursive, $folderNameFilterCallbacks));
        }
 
index 607905b..93f15a2 100644 (file)
@@ -202,7 +202,7 @@ class Folder implements FolderInterface {
         * @return int
         */
        public function getFileCount(array $filterMethods = array(), $recursive = FALSE) {
-               return $this->storage->getFilesInFolderCount($this, TRUE, $recursive);
+               return $this->storage->countFilesInFolder($this, TRUE, $recursive);
        }
 
        /**
index 163aae7..acbf72c 100644 (file)
@@ -1357,10 +1357,10 @@ class ResourceStorage implements ResourceStorageInterface {
         * @param bool $recursive
         * @return int Number of files in folder
         */
-       public function getFilesInFolderCount(Folder $folder, $useFilters = TRUE, $recursive = FALSE) {
+       public function countFilesInFolder(Folder $folder, $useFilters = TRUE, $recursive = FALSE) {
                $this->assureFolderReadPermission($folder);
                $filters = $useFilters ? $this->fileAndFolderNameFilters : array();
-               return $this->driver->getFilesInFolderCount($folder->getIdentifier(), $recursive, $filters);
+               return $this->driver->countFilesInFolder($folder->getIdentifier(), $recursive, $filters);
        }
 
        /**
@@ -1990,10 +1990,10 @@ class ResourceStorage implements ResourceStorageInterface {
         * @param bool $recursive
         * @return integer Number of subfolders
         */
-       public function getFoldersInFolderCount(Folder $folder, $useFilters = TRUE, $recursive = FALSE) {
+       public function countFoldersInFolder(Folder $folder, $useFilters = TRUE, $recursive = FALSE) {
                $this->assureFolderReadPermission($folder);
                $filters = $useFilters ? $this->fileAndFolderNameFilters : array();
-               return $this->driver->getFoldersInFolderCount($folder->getIdentifier(), $recursive, $filters);
+               return $this->driver->countFoldersInFolder($folder->getIdentifier(), $recursive, $filters);
        }
 
        /**
index ee700cc..7c2efe2 100644 (file)
@@ -30,8 +30,8 @@ The custom FAL drivers need to be updated to be in line with the updated DriverI
 
 2 new functions need to be added:
 
- - ``getFoldersInFolderCount()``
- - ``getFilesInFolderCount()``
+ - ``countFoldersInFolder()``
+ - ``countFilesInFolder()``
 
 2 functions need to be extended with the parameters $sort and $sortRev:
 
index 356069e..a77473c 100644 (file)
@@ -306,8 +306,8 @@ class FileList extends AbstractRecordList {
 
                // Only render the contents of a browsable storage
                if ($this->folderObject->getStorage()->isBrowsable()) {
-                       $foldersCount = $storage->getFoldersInFolderCount($this->folderObject);
-                       $filesCount = $storage->getFilesInFolderCount($this->folderObject);
+                       $foldersCount = $storage->countFoldersInFolder($this->folderObject);
+                       $filesCount = $storage->countFilesInFolder($this->folderObject);
 
                        if ($foldersCount <= $this->firstElementNumber) {
                                $foldersFrom = FALSE;
@@ -964,4 +964,4 @@ class FileList extends AbstractRecordList {
                return $GLOBALS['BE_USER'];
        }
 
-}
\ No newline at end of file
+}