concrete/src/Entity/File/File.php
public function getDownloadStatistics($limit = 20)
    {
        $db = Loader::db();
        $limitString = '';
        if ($limit != false) {
            $limitString = 'limit ' . intval($limit);
        }

        if (is_object($this) && $this instanceof self) {
            return $db->getAll(
                "SELECT * FROM DownloadStatistics WHERE fID = ? ORDER BY timestamp desc {$limitString}",
                [$this->getFileID()]
            );
        } else {
            return $db->getAll("SELECT * FROM DownloadStatistics ORDER BY timestamp desc {$limitString}");
        }
    }
public function getDownloadStatistics($limit = 20)
    {
        $db = Loader::db();
        $limitString = '';
        if ($limit != false) {
            $limitString = 'limit ' . intval($limit);
        }

        if (is_object($this) && $this instanceof self) {
            return $db->getAll(
                "SELECT * FROM DownloadStatistics WHERE fID = ? ORDER BY timestamp desc {$limitString}",
                [$this->getFileID()]
            );
        } else {
            return $db->getAll("SELECT * FROM DownloadStatistics ORDER BY timestamp desc {$limitString}");
        }
    }
public function getDownloadStatistics ( $ limit = 20 ) { $ db = Loader :: db ( ) ; $ limitString = '' ; if ( $ limit != false ) { $ limitString = 'limit ' . intval ( $ limit ) ; } if ( is_object ( $ this ) && $ this instanceof self ) { return $ db -> getAll ( "SELECT * FROM DownloadStatistics WHERE fID = ? ORDER BY timestamp desc {$limitString}" , [ $ this -> getFileID ( ) ] ) ; } else { return $ db -> getAll ( "SELECT * FROM DownloadStatistics ORDER BY timestamp desc {$limitString}" ) ; } }
Get the download statistics for the current file.

@param int $limit max number of stats to retrieve

@return array
Get the download statistics for the current file .