library/Garp/Model/Db/Image.php
public function afterFetch(&$args) {
        $results = &$args[1];
        $scaler = new Garp_Image_Scaler();
        $templateUrl = (string)$scaler->getScaledUrl('%d', '%s');
        $templates = array_keys(Zend_Registry::get('config')->image->template->toArray());
        $iterator = new Garp_Db_Table_Rowset_Iterator(
            $results,
            function ($result) use ($templates, $templateUrl) {
                if (!isset($result->id)) {
                    return;
                }
                $result->setVirtual(
                    'urls',
                    array_reduce(
                        $templates,
                        function ($acc, $cur) use ($templateUrl, $result) {
                            $acc[$cur] = sprintf($templateUrl, $cur, $result->id);
                            return $acc;
                        },
                        array()
                    )
                );
            }
        );
        $iterator->walk();
    }
public function afterFetch(&$args) {
        $results = &$args[1];
        $scaler = new Garp_Image_Scaler();
        $templateUrl = (string)$scaler->getScaledUrl('%d', '%s');
        $templates = array_keys(Zend_Registry::get('config')->image->template->toArray());
        $iterator = new Garp_Db_Table_Rowset_Iterator(
            $results,
            function ($result) use ($templates, $templateUrl) {
                if (!isset($result->id)) {
                    return;
                }
                $result->setVirtual(
                    'urls',
                    array_reduce(
                        $templates,
                        function ($acc, $cur) use ($templateUrl, $result) {
                            $acc[$cur] = sprintf($templateUrl, $cur, $result->id);
                            return $acc;
                        },
                        array()
                    )
                );
            }
        );
        $iterator->walk();
    }
public function afterFetch ( & $ args ) { $ results = & $ args [ 1 ] ; $ scaler = new Garp_Image_Scaler ( ) ; $ templateUrl = ( string ) $ scaler -> getScaledUrl ( '%d' , '%s' ) ; $ templates = array_keys ( Zend_Registry :: get ( 'config' ) -> image -> template -> toArray ( ) ) ; $ iterator = new Garp_Db_Table_Rowset_Iterator ( $ results , function ( $ result ) use ( $ templates , $ templateUrl ) { if ( ! isset ( $ result -> id ) ) { return ; } $ result -> setVirtual ( 'urls' , array_reduce ( $ templates , function ( $ acc , $ cur ) use ( $ templateUrl , $ result ) { $ acc [ $ cur ] = sprintf ( $ templateUrl , $ cur , $ result -> id ) ; return $ acc ; } , array ( ) ) ) ; } ) ; $ iterator -> walk ( ) ; }
Include preview URLs in the resultset

@param array $args
@return void
Include preview URLs in the resultset