update changelog and fix cs
This commit is contained in:
@@ -4,7 +4,6 @@ namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderQuery as BaseFolderQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'folder' table.
|
||||
*
|
||||
@@ -21,7 +20,7 @@ class FolderQuery extends BaseFolderQuery
|
||||
*
|
||||
* count how many direct contents a folder has
|
||||
*
|
||||
* @param int $parent folder id
|
||||
* @param int $parent folder id
|
||||
* @return int
|
||||
*/
|
||||
public static function countChild($parent)
|
||||
@@ -33,16 +32,16 @@ class FolderQuery extends BaseFolderQuery
|
||||
* find all contents for a given folder.
|
||||
*
|
||||
* @param $folderId the folder id or an array of id
|
||||
* @param int $depth max depth you want to search
|
||||
* @param int $currentPosition don't change this param, it is used for recursion
|
||||
* @param int $depth max depth you want to search
|
||||
* @param int $currentPosition don't change this param, it is used for recursion
|
||||
* @return \Thelia\Model\Folder[]
|
||||
*/
|
||||
public static function findAllChild($folderId, $depth = 0, $currentPosition = 0)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
if(is_array($folderId)) {
|
||||
foreach($folderId as $folderSingleId) {
|
||||
if (is_array($folderId)) {
|
||||
foreach ($folderId as $folderSingleId) {
|
||||
$result = array_merge($result, (array) self::findAllChild($folderSingleId, $depth, $currentPosition));
|
||||
}
|
||||
} else {
|
||||
@@ -54,7 +53,6 @@ class FolderQuery extends BaseFolderQuery
|
||||
->filterByParent($folderId)
|
||||
->find();
|
||||
|
||||
|
||||
foreach ($categories as $folder) {
|
||||
array_push($result, $folder);
|
||||
$result = array_merge($result, (array) self::findAllChild($folder->getId(), $depth, $currentPosition));
|
||||
|
||||
Reference in New Issue
Block a user