allow to create new content

This commit is contained in:
Manuel Raynaud
2013-09-21 16:38:22 +02:00
parent 1da66ece29
commit 4e3768e0e9
5 changed files with 40 additions and 6 deletions

View File

@@ -34,8 +34,13 @@ class Content extends BaseContent
public function getDefaultFolderId()
{
//@TODO update contentFolder Table, adding by_default column and change this code for returnin good value
return $this->getFolders()->getFirst()->getId();
// Find default folder
$default_folder = ContentFolderQuery::create()
->filterByContentId($this->getId())
->filterByDefaultFolder(true)
->findOne();
return $default_folder == null ? 0 : $default_folder->getFolderId();
}