Verified Commit 346302aa authored by Jan Wennrich's avatar Jan Wennrich 🎓

feat: implemented countFilesForProject()-method-body in media utils

parent 8e82507f
......@@ -859,9 +859,28 @@ class Utils
*/
public static function countFilesForProject(QUI\Projects\Project $Project)
{
// TODO: implement countFilesForProject() logic
$mediaTable = $Project->getMedia()->getTable();
return -1;
try {
$result = QUI::getDataBase()->fetch([
'count' => 'id',
'from' => $mediaTable,
'where' => [
'type' => [
'type' => 'NOT',
'value' => 'folder'
]
]
]);
} catch (QUI\Exception $Exception) {
return 0;
}
if (isset($result[0])) {
return intval($result[0]);
}
return 0;
}
......
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