src/apis/StorageController.php
public function actionIsFolderEmpty($folderId)
    {
        $count = StorageFile::find()->where(['folder_id' => $folderId, 'is_deleted' => false])->count();
        
        return [
            'count' => $count,
            'empty' => $count > 0  ? false : true,
        ];
    }
public function actionIsFolderEmpty($folderId)
    {
        $count = StorageFile::find()->where(['folder_id' => $folderId, 'is_deleted' => false])->count();
        
        return [
            'count' => $count,
            'empty' => $count > 0  ? false : true,
        ];
    }
public function actionIsFolderEmpty ( $ folderId ) { $ count = StorageFile :: find ( ) -> where ( [ 'folder_id' => $ folderId , 'is_deleted' => false ] ) -> count ( ) ; return [ 'count' => $ count , 'empty' => $ count > 0 ? false : true , ] ; }
Check whether a folder is empty or not in order to delete this folder.

@param integer $folderId The folder id to check whether it has files or not.
@return boolean
Check whether a folder is empty or not in order to delete this folder .