Verified Commit 8e82507f authored by Jan Wennrich's avatar Jan Wennrich 🎓

feat: added countFoldersForProject() method to media utils

parent a14f2abc
......@@ -828,8 +828,25 @@ class Utils
*/
public static function countFoldersForProject(QUI\Projects\Project $Project)
{
// TODO: implement countFoldersForProject() logic
return -1;
$mediaTable = $Project->getMedia()->getTable();
try {
$result = QUI::getDataBase()->fetch([
'count' => 'id',
'from' => $mediaTable,
'where' => [
'type' => 'folder'
]
]);
} catch (QUI\Exception $Exception) {
return 0;
}
if (isset($result[0])) {
return intval($result[0]);
}
return 0;
}
......@@ -888,7 +905,7 @@ class Utils
public static function countFiletypesForProject(QUI\Projects\Project $Project)
{
// TODO: implement countFiletypesForProject() logic
return [];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment