Merge branch 'master' into brands

Conflicts:
	core/lib/Thelia/Tools/FileManager.php
	setup/update/2.0.3.sql
This commit is contained in:
Franck Allimant
2014-06-26 16:35:08 +02:00
26 changed files with 535 additions and 144 deletions

View File

@@ -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
*/