src/Service/Cdn.php
public function urlExpiring($iObjectId, $expires, $forceDownload = false)
    {
        if (is_numeric($iObjectId)) {

            $oObj = $this->getObject($iObjectId);

            if (!$oObj) {
                //  Let the renderer show a bad_src graphic
                $oObj = (object) [
                    'file'   => (object) [
                        'name' => (object) [
                            'disk' => '',
                        ],
                    ],
                    'bucket' => (object) [
                        'slug' => '',
                    ],
                ];
            }

        } else {
            $oObj = $iObjectId;
        }

        return $this->callDriver(
            'urlExpiring',
            [$oObj->file->name->disk, $oObj->bucket->slug, $expires, $forceDownload],
            $oObj->driver
        );
    }
public function urlExpiring($iObjectId, $expires, $forceDownload = false)
    {
        if (is_numeric($iObjectId)) {

            $oObj = $this->getObject($iObjectId);

            if (!$oObj) {
                //  Let the renderer show a bad_src graphic
                $oObj = (object) [
                    'file'   => (object) [
                        'name' => (object) [
                            'disk' => '',
                        ],
                    ],
                    'bucket' => (object) [
                        'slug' => '',
                    ],
                ];
            }

        } else {
            $oObj = $iObjectId;
        }

        return $this->callDriver(
            'urlExpiring',
            [$oObj->file->name->disk, $oObj->bucket->slug, $expires, $forceDownload],
            $oObj->driver
        );
    }
public function urlExpiring ( $ iObjectId , $ expires , $ forceDownload = false ) { if ( is_numeric ( $ iObjectId ) ) { $ oObj = $ this -> getObject ( $ iObjectId ) ; if ( ! $ oObj ) { //  Let the renderer show a bad_src graphic $ oObj = ( object ) [ 'file' => ( object ) [ 'name' => ( object ) [ 'disk' => '' , ] , ] , 'bucket' => ( object ) [ 'slug' => '' , ] , ] ; } } else { $ oObj = $ iObjectId ; } return $ this -> callDriver ( 'urlExpiring' , [ $ oObj -> file -> name -> disk , $ oObj -> bucket -> slug , $ expires , $ forceDownload ] , $ oObj -> driver ) ; }
Generates an expiring URL for an object

@param integer $iObjectId     The object's ID
@param integer $expires       The length of time the URL should be valid for, in seconds
@param boolean $forceDownload Whether to force the download or not

@return string
Generates an expiring URL for an object