src/Api/Controller/CdnObject.php
protected function generateUrls($oObject, $aUrls)
    {
        $oCdn = Factory::service('Cdn', 'nails/module-cdn');
        $aOut = ['src' => $oCdn->urlServe($oObject)];

        if (!empty($aUrls) && $oObject->is_img) {
            foreach ($aUrls as $aDimension) {

                $sProperty = $aDimension['width'] . 'x' . $aDimension['height'] . '-' . $aDimension['type'];

                switch ($aDimension['type']) {
                    case 'crop':
                        $aOut[$sProperty] = $oCdn->urlCrop(
                            $oObject,
                            $aDimension['width'],
                            $aDimension['height']
                        );
                        break;

                    case 'scale':
                        $aOut[$sProperty] = $oCdn->urlScale(
                            $oObject,
                            $aDimension['width'],
                            $aDimension['height']
                        );
                        break;
                }
            }
        }

        return $aOut;
    }
protected function generateUrls($oObject, $aUrls)
    {
        $oCdn = Factory::service('Cdn', 'nails/module-cdn');
        $aOut = ['src' => $oCdn->urlServe($oObject)];

        if (!empty($aUrls) && $oObject->is_img) {
            foreach ($aUrls as $aDimension) {

                $sProperty = $aDimension['width'] . 'x' . $aDimension['height'] . '-' . $aDimension['type'];

                switch ($aDimension['type']) {
                    case 'crop':
                        $aOut[$sProperty] = $oCdn->urlCrop(
                            $oObject,
                            $aDimension['width'],
                            $aDimension['height']
                        );
                        break;

                    case 'scale':
                        $aOut[$sProperty] = $oCdn->urlScale(
                            $oObject,
                            $aDimension['width'],
                            $aDimension['height']
                        );
                        break;
                }
            }
        }

        return $aOut;
    }
protected function generateUrls ( $ oObject , $ aUrls ) { $ oCdn = Factory :: service ( 'Cdn' , 'nails/module-cdn' ) ; $ aOut = [ 'src' => $ oCdn -> urlServe ( $ oObject ) ] ; if ( ! empty ( $ aUrls ) && $ oObject -> is_img ) { foreach ( $ aUrls as $ aDimension ) { $ sProperty = $ aDimension [ 'width' ] . 'x' . $ aDimension [ 'height' ] . '-' . $ aDimension [ 'type' ] ; switch ( $ aDimension [ 'type' ] ) { case 'crop' : $ aOut [ $ sProperty ] = $ oCdn -> urlCrop ( $ oObject , $ aDimension [ 'width' ] , $ aDimension [ 'height' ] ) ; break ; case 'scale' : $ aOut [ $ sProperty ] = $ oCdn -> urlScale ( $ oObject , $ aDimension [ 'width' ] , $ aDimension [ 'height' ] ) ; break ; } } } return $ aOut ; }
Generate the requested URLs

@param \stdClass $oObject The object object
@param array     $aUrls   The URLs to generate

@return array
Generate the requested URLs