# sendy/3.4.7/lib/Repositories/Preferences.php

Sendy, version 3.4.7. 36 lines.

- Page: https://pluginprobe.com/plugins/sendy/3.4.7/code/lib/Repositories/Preferences.php
- Raw: https://pluginprobe.com/plugins/sendy/3.4.7/raw/lib/Repositories/Preferences.php
- Modified: 2026-01-13T15:11: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/sendy/3.4.7/code/lib/Repositories/Preferences.php#L10-L20`.

```php
<?php

namespace Sendy\WooCommerce\Repositories;

class Preferences extends Repository
{
    /**
     * Returns a map of shipping preferences
     *
     * The preferences are stored in the transient for the duration of one hour. The results from the API are
     * transformed to map of preferences with the UUID as key and the name as value.
     *
     * @return array<string,string>
     * @throws \GuzzleHttp\Exception\GuzzleException
     * @throws \Sendy\Api\ApiException
     */
    public function get(): array
    {
        $preferences = get_transient('sendy_shipping_preferences');

        if (! $preferences) {
            $result = $this->connection()->shippingPreference->list();

            $preferences = [];

            foreach ($result as $preference) {
                $preferences[$preference['uuid']] = $preference['name'];
            }

            set_transient('sendy_shipping_preferences', $preferences, 3600);
        }

        return $preferences;
    }
}

```
