29 lines
896 B
PHP
29 lines
896 B
PHP
<?php
|
|
|
|
namespace App\User\Action\Command;
|
|
|
|
use OneToMany\RichBundle\Contract\CommandInterface;
|
|
use Symfony\Component\Form\FormInterface;
|
|
|
|
/** @implements CommandInterface<SaveUserMediaPreferencesCommand> */
|
|
class SaveUserMediaPreferencesCommand implements CommandInterface
|
|
{
|
|
public function __construct(
|
|
public string $resolution,
|
|
public string $codec,
|
|
public string $quality,
|
|
public string $language,
|
|
public string $provider,
|
|
) {}
|
|
|
|
public static function fromUserMediaPreferencesForm(FormInterface $form): self
|
|
{
|
|
return new static(
|
|
resolution: $form->get('resolution')->getData(),
|
|
codec: $form->get('codec')->getData(),
|
|
quality: $form->get('quality')->getData(),
|
|
language: $form->get('language')->getData(),
|
|
provider: $form->get('provider')->getData(),
|
|
);
|
|
}
|
|
} |