Merge branch 'master' into brands
Conflicts: core/lib/Thelia/Tools/FileManager.php setup/update/2.0.3.sql
This commit is contained in:
@@ -56,6 +56,28 @@ class Folder extends BaseFolder implements FileModelParentInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the root folder
|
||||
* @param int $folderId
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRoot($folderId)
|
||||
{
|
||||
|
||||
$folder = FolderQuery::create()->findPk($folderId);
|
||||
|
||||
if(0 !== $folder->getParent()) {
|
||||
$parentFolder = FolderQuery::create()->findPk($folder->getParent());
|
||||
|
||||
if (null !== $parentFolder) {
|
||||
$folderId = $this->getRoot($parentFolder->getId());
|
||||
}
|
||||
}
|
||||
|
||||
return $folderId;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate next position relative to our parent
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user