expiry example

return 0 === \count($idsErrors);
    }

    protected function doSave(array $values$lifetime): array|bool
    {
        if (!$values = $this->marshaller->marshall($values$failed)) {
            return $failed;
        }

        $upsertOptions = new UpsertOptions();
        $upsertOptions->expiry($lifetime);

        $ko = [];
        foreach ($values as $key => $value) {
            try {
                $this->connection->upsert($key$value$upsertOptions);
            } catch (\Exception) {
                $ko[$key] = '';
            }
        }

        return [] === $ko ? true : $ko;
    }
use Symfony\Component\Notifier\Bridge\MessageMedia\MessageMediaOptions;

class MessageMediaOptionsTest extends TestCase
{
    public function testMessageMediaOptions()
    {
        $messageMediaOptions = (new MessageMediaOptions())->
            media(['test_media'])
            ->callbackUrl('test_callback_url')
            ->format('test_format')
            ->deliveryReport(true)
            ->expiry(999)
            ->metadata(['test_metadata'])
            ->scheduled('test_scheduled')
            ->subject('test_subject');

        self::assertSame([
            'media' => ['test_media'],
            'callback_url' => 'test_callback_url',
            'format' => 'test_format',
            'delivery_report' => true,
            'message_expiry_timestamp' => 999,
            'metadata' => ['test_metadata'],
            
Home | Imprint | This part of the site doesn't use cookies.