concrete/src/Entity/File/File.php
public function trackDownload($rcID = null)
    {
        $u = new User();
        $uID = intval($u->getUserID());
        $fv = $this->getApprovedVersion();
        $fvID = $fv->getFileVersionID();
        if (!isset($rcID) || !is_numeric($rcID)) {
            $rcID = 0;
        }

        $fve = new \Concrete\Core\File\Event\FileAccess($fv);
        Events::dispatch('on_file_download', $fve);

        $config = Core::make('config');
        if ($config->get('concrete.statistics.track_downloads')) {
            $db = Loader::db();
            $db->Execute(
                'insert into DownloadStatistics (fID, fvID, uID, rcID) values (?, ?, ?, ?)',
                [$this->fID, intval($fvID), $uID, $rcID]
            );
        }
    }
public function trackDownload($rcID = null)
    {
        $u = new User();
        $uID = intval($u->getUserID());
        $fv = $this->getApprovedVersion();
        $fvID = $fv->getFileVersionID();
        if (!isset($rcID) || !is_numeric($rcID)) {
            $rcID = 0;
        }

        $fve = new \Concrete\Core\File\Event\FileAccess($fv);
        Events::dispatch('on_file_download', $fve);

        $config = Core::make('config');
        if ($config->get('concrete.statistics.track_downloads')) {
            $db = Loader::db();
            $db->Execute(
                'insert into DownloadStatistics (fID, fvID, uID, rcID) values (?, ?, ?, ?)',
                [$this->fID, intval($fvID), $uID, $rcID]
            );
        }
    }
public function trackDownload ( $ rcID = null ) { $ u = new User ( ) ; $ uID = intval ( $ u -> getUserID ( ) ) ; $ fv = $ this -> getApprovedVersion ( ) ; $ fvID = $ fv -> getFileVersionID ( ) ; if ( ! isset ( $ rcID ) || ! is_numeric ( $ rcID ) ) { $ rcID = 0 ; } $ fve = new \ Concrete \ Core \ File \ Event \ FileAccess ( $ fv ) ; Events :: dispatch ( 'on_file_download' , $ fve ) ; $ config = Core :: make ( 'config' ) ; if ( $ config -> get ( 'concrete.statistics.track_downloads' ) ) { $ db = Loader :: db ( ) ; $ db -> Execute ( 'insert into DownloadStatistics (fID, fvID, uID, rcID) values (?, ?, ?, ?)' , [ $ this -> fID , intval ( $ fvID ) , $ uID , $ rcID ] ) ; } }
Tracks File Download, takes the cID of the page that the file was downloaded from.

@param int $rcID
Tracks File Download takes the cID of the page that the file was downloaded from .