fix minor bug

This commit is contained in:
Manuel Raynaud
2014-05-09 10:55:50 +02:00
parent d9d350ea24
commit 85d80d1d77
31 changed files with 243 additions and 309 deletions

View File

@@ -56,9 +56,21 @@ class Content extends BaseContent
public function setDefaultFolder($folderId)
{
/* ContentFolderQuery::create()
->filterByContentId($this->getId)
->update(array("DefaultFolder" => 0));*/
// Unset previous category
ContentFolderQuery::create()
->filterByContentId($this->getId())
->filterByDefaultFolder(true)
->find()
->setByDefault(false)
->save();
// Set new default category
ContentFolderQuery::create()
->filterByContentId($this->getId())
->filterByFolderId($folderId)
->find()
->setByDefault(true)
->save();
return $this;
}