# fluent-cart/1.6.4/app/Services/ShortCodeParser/Parsers/DownloadParser.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 37 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Services/ShortCodeParser/Parsers/DownloadParser.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Services/ShortCodeParser/Parsers/DownloadParser.php
- Modified: 2026-03-13T16:10:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Services/ShortCodeParser/Parsers/DownloadParser.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Services\ShortCodeParser\Parsers;

use FluentCart\Framework\Support\Arr;

class DownloadParser extends BaseParser
{
    private $download;

    public function __construct($data)
    {
        $this->download = Arr::get($data, 'download', []);
        parent::__construct($data);
    }

    public function parse($accessor = null, $code = null, $transformer = null): ?string
    {
        $download = $this->download;

        switch ($accessor) {
            case 'sl':
                return (string) (isset($download['sl']) ? $download['sl'] : '');
            case 'title':
                return esc_html(isset($download['title']) ? $download['title'] : '');
            case 'product_name':
                return esc_html(isset($download['product_name']) ? $download['product_name'] : '');
            case 'url':
                return esc_url(isset($download['download_url']) ? $download['download_url'] : '');
            case 'file_size':
                return esc_html(isset($download['formatted_file_size']) ? $download['formatted_file_size'] : '');
            default:
                return Arr::get($download, $accessor, '');
        }
    }
}

```
