Update entities to handle Doctrine 2.9.1's prop type rollback.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-06-08 20:38:18 -05:00
parent 3f23efa076
commit 50d1840826
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
36 changed files with 223 additions and 207 deletions

View File

@ -31,11 +31,11 @@ class Analytics
public const INTERVAL_DAILY = 'day';
public const INTERVAL_HOURLY = 'hour';
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $station_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?Station $station = null;
#[ORM\Column(length: 15)]
@ -53,7 +53,7 @@ class Analytics
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
protected string $number_avg;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $number_unique = null;
public function __construct(

View File

@ -20,10 +20,10 @@ class ApiKey implements JsonSerializable, Stringable
use Traits\TruncateStrings;
#[ORM\ManyToOne(targetEntity: User::class, fetch: 'EAGER', inversedBy: 'api_keys')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected User $user;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $comment = null;
public function __construct(User $user, SplitToken $token)

View File

@ -34,16 +34,16 @@ class AuditLog
#[ORM\Column(length: 255)]
protected string $identifier;
#[ORM\Column(name: 'target_class', length: 255)]
#[ORM\Column(name: 'target_class', length: 255, nullable: true)]
protected ?string $targetClass;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $target;
#[ORM\Column(type: 'array')]
protected array $changes;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $user;
public function __construct(

View File

@ -25,11 +25,11 @@ class CustomField implements \Stringable
protected string $name;
/** @OA\Property(description="The programmatic name for the field. Can be auto-generated from the full name.") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $short_name = null;
/** @OA\Property(description="An ID3v2 field to automatically assign to this value, if it exists in the media file.") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $auto_assign = null;
public function getName(): string

View File

@ -17,25 +17,25 @@ class Listener
use Traits\HasAutoIncrementId;
use Traits\TruncateStrings;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'history')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $mount_id = null;
#[ORM\ManyToOne(targetEntity: StationMount::class)]
#[ORM\JoinColumn(name: 'mount_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(name: 'mount_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?StationMount $mount = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $remote_id = null;
#[ORM\ManyToOne(targetEntity: StationRemote::class)]
#[ORM\JoinColumn(name: 'remote_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(name: 'remote_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?StationRemote $remote = null;
#[ORM\Column]

View File

@ -37,6 +37,6 @@ class MessengerMessage
#[ORM\Column(name: 'available_at')]
protected DateTime $availableAt;
#[ORM\Column(name: 'delivered_at')]
#[ORM\Column(name: 'delivered_at', nullable: true)]
protected ?DateTime $deliveredAt = null;
}

View File

@ -23,14 +23,14 @@ class Podcast
public const DIR_PODCAST_ARTWORK = '.podcast_art';
#[ORM\ManyToOne(targetEntity: StorageLocation::class)]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StorageLocation $storage_location;
#[ORM\Column(length: 255)]
#[Assert\NotBlank]
protected string $title;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $link = null;
#[ORM\Column(type: 'text')]

View File

@ -20,7 +20,7 @@ class PodcastCategory
public const CATEGORY_SEPARATOR = '|';
#[ORM\ManyToOne(inversedBy: 'categories')]
#[ORM\JoinColumn(name: 'podcast_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'podcast_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Podcast $podcast;
#[ORM\Column(length: 255)]

View File

@ -22,7 +22,7 @@ class PodcastEpisode
public const DIR_PODCAST_EPISODE_ARTWORK = '.podcast_episode_art';
#[ORM\ManyToOne(inversedBy: 'episodes')]
#[ORM\JoinColumn(name: 'podcast_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'podcast_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Podcast $podcast;
#[ORM\OneToOne(mappedBy: 'episode')]
@ -32,14 +32,14 @@ class PodcastEpisode
#[Assert\NotBlank]
protected string $title;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $link = null;
#[ORM\Column(type: 'text')]
#[Assert\NotBlank]
protected string $description;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $publish_at = null;
#[ORM\Column]

View File

@ -20,11 +20,11 @@ class PodcastMedia
use Traits\TruncateStrings;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StorageLocation $storage_location;
#[ORM\OneToOne(inversedBy: 'media')]
#[ORM\JoinColumn(name: 'episode_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(name: 'episode_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?PodcastEpisode $episode;
#[ORM\Column(length: 200)]

View File

@ -25,7 +25,7 @@ class Relay
protected string $base_url;
/** @OA\Property(example="Relay") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $name = 'Relay';
/** @OA\Property(example=true) */

View File

@ -20,17 +20,17 @@ class RolePermission implements JsonSerializable
protected int $role_id;
#[ORM\ManyToOne(inversedBy: 'permissions')]
#[ORM\JoinColumn(name: 'role_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'role_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Role $role;
#[ORM\Column(length: 50)]
protected string $action_name;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $station_id = null;
#[ORM\ManyToOne(inversedBy: 'permissions')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?Station $station = null;
public function __construct(Role $role, Station $station = null, $action_name = null)

View File

@ -37,7 +37,7 @@ class Settings implements Stringable
* example="https://your.azuracast.site"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $base_url = '';
public function getBaseUrl(): ?string
@ -56,7 +56,7 @@ class Settings implements Stringable
* example="My AzuraCast Instance"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $instance_name = null;
public function getInstanceName(): ?string
@ -151,7 +151,7 @@ class Settings implements Stringable
* example="*"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $api_access_control = '';
public function getApiAccessControl(): string
@ -188,7 +188,7 @@ class Settings implements Stringable
* description="Listener Analytics Collection"
* )
*/
#[ORM\Column(length: 50)]
#[ORM\Column(length: 50, nullable: true)]
#[Assert\Choice([Analytics::LEVEL_NONE, Analytics::LEVEL_NO_IP, Analytics::LEVEL_ALL])]
protected ?string $analytics = Analytics::LEVEL_ALL;
@ -276,7 +276,7 @@ class Settings implements Stringable
* example="light"
* )
*/
#[ORM\Column(length: 50)]
#[ORM\Column(length: 50, nullable: true)]
#[Assert\Choice([Customization::THEME_BROWSER, Customization::THEME_LIGHT, Customization::THEME_DARK])]
protected ?string $public_theme = Customization::DEFAULT_THEME;
@ -315,7 +315,7 @@ class Settings implements Stringable
* example="https://example.com/"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $homepage_redirect_url = null;
public function getHomepageRedirectUrl(): ?string
@ -334,7 +334,7 @@ class Settings implements Stringable
* example="https://example.com/image.jpg"
* )
*/
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?string $default_album_art_url = null;
public function getDefaultAlbumArtUrl(): ?string
@ -391,7 +391,7 @@ class Settings implements Stringable
* example="SAMPLE-API-KEY"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $last_fm_api_key = null;
public function getLastFmApiKey(): ?string
@ -432,7 +432,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $public_custom_css = null;
public function getPublicCustomCss(): ?string
@ -451,7 +451,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $public_custom_js = null;
public function getPublicCustomJs(): ?string
@ -470,7 +470,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $internal_custom_css = null;
public function getInternalCustomCss(): ?string
@ -508,7 +508,7 @@ class Settings implements Stringable
* example=400
* )
*/
#[ORM\Column(length: 4)]
#[ORM\Column(length: 4, nullable: true)]
protected ?string $backup_time_code = null;
public function getBackupTimeCode(): ?string
@ -565,7 +565,7 @@ class Settings implements Stringable
* example=1
* )
*/
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $backup_storage_location = null;
public function getBackupStorageLocation(): ?int
@ -609,7 +609,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $backup_last_result = null;
@ -629,7 +629,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $backup_last_output = null;
@ -679,7 +679,7 @@ class Settings implements Stringable
* )
* @var mixed[]|null
*/
#[ORM\Column(type: 'json')]
#[ORM\Column(type: 'json', nullable: true)]
#[Attributes\AuditIgnore]
protected ?array $nowplaying = null;
@ -815,7 +815,7 @@ class Settings implements Stringable
* example="192.168.1.1"
* )
*/
#[ORM\Column(length: 45)]
#[ORM\Column(length: 45, nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $external_ip = null;
@ -835,7 +835,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $geolite_license_key = null;
public function getGeoliteLicenseKey(): ?string
@ -919,7 +919,7 @@ class Settings implements Stringable
* example="AzuraCast"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $mail_sender_name = '';
public function getMailSenderName(): string
@ -938,7 +938,7 @@ class Settings implements Stringable
* example="example@example.com"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $mail_sender_email = '';
public function getMailSenderEmail(): string
@ -957,7 +957,7 @@ class Settings implements Stringable
* example="smtp.example.com"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $mail_smtp_host = '';
public function getMailSmtpHost(): string
@ -995,7 +995,7 @@ class Settings implements Stringable
* example="username"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $mail_smtp_username = '';
public function getMailSmtpUsername(): string
@ -1014,7 +1014,7 @@ class Settings implements Stringable
* example="password"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $mail_smtp_password = '';
public function getMailSmtpPassword(): string
@ -1052,7 +1052,7 @@ class Settings implements Stringable
* example="libravatar"
* )
*/
#[ORM\Column(length: 25)]
#[ORM\Column(length: 25, nullable: true)]
protected ?string $avatar_service = null;
public function getAvatarService(): string
@ -1071,7 +1071,7 @@ class Settings implements Stringable
* example=""
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $avatar_default_url = null;
public function getAvatarDefaultUrl(): string

View File

@ -20,7 +20,7 @@ class SftpUser
use Traits\HasAutoIncrementId;
#[ORM\ManyToOne(inversedBy: 'sftp_users')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column(length: 32)]
@ -33,7 +33,7 @@ class SftpUser
#[Assert\NotBlank]
protected string $password;
#[ORM\Column(name: 'public_keys', type: 'text')]
#[ORM\Column(name: 'public_keys', type: 'text', nullable: true)]
protected ?string $publicKeys = null;
public function __construct(Station $station)

View File

@ -22,57 +22,57 @@ class SongHistory implements SongInterface
/** @var int */
public const DEFAULT_DAYS_TO_KEEP = 60;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'history')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $playlist_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationPlaylist $playlist = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $streamer_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'streamer_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'streamer_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationStreamer $streamer = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $media_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationMedia $media = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $request_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'request_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'request_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationRequest $request = null;
#[ORM\Column]
protected int $timestamp_start = 0;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $duration = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $listeners_start = null;
#[ORM\Column]
protected int $timestamp_end = 0;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $listeners_end = 0;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $unique_listeners = 0;
#[ORM\Column]

View File

@ -48,7 +48,7 @@ class Station implements Stringable
* example="AzuraTest Radio"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
#[Assert\NotBlank]
protected ?string $name = null;
@ -58,7 +58,7 @@ class Station implements Stringable
* example="azuratest_radio"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
#[Assert\NotBlank]
protected ?string $short_name = null;
@ -77,7 +77,7 @@ class Station implements Stringable
* example="icecast"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
#[Assert\Choice(choices: [Adapters::FRONTEND_ICECAST, Adapters::FRONTEND_REMOTE, Adapters::FRONTEND_SHOUTCAST])]
protected ?string $frontend_type = Adapters::FRONTEND_ICECAST;
@ -97,7 +97,7 @@ class Station implements Stringable
* example="liquidsoap"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
#[Assert\Choice(choices: [Adapters::BACKEND_LIQUIDSOAP, Adapters::BACKEND_NONE])]
protected ?string $backend_type = Adapters::BACKEND_LIQUIDSOAP;
@ -111,39 +111,39 @@ class Station implements Stringable
#[ORM\Column(type: 'json', nullable: true)]
protected ?array $backend_config = null;
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $adapter_api_key = null;
/** @OA\Property(example="A sample radio station.") */
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $description = null;
/** @OA\Property(example="https://demo.azuracast.com/") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $url = null;
/** @OA\Property(example="Various") */
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
protected ?string $genre = null;
/** @OA\Property(example="/var/azuracast/stations/azuratest_radio") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $radio_base_dir = null;
#[ORM\Column(type: 'array', nullable: true)]
#[Attributes\AuditIgnore]
protected mixed $nowplaying;
#[ORM\Column]
#[ORM\Column(nullable: true)]
#[Attributes\AuditIgnore]
protected ?int $nowplaying_timestamp = null;
/** @OA\Property(type="array", @OA\Items()) */
#[ORM\Column(type: 'json')]
#[ORM\Column(type: 'json', nullable: true)]
protected ?array $automation_settings = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
#[Attributes\AuditIgnore]
protected ?int $automation_timestamp = 0;
@ -157,15 +157,15 @@ class Station implements Stringable
protected bool $enable_requests = false;
/** @OA\Property(example=5) */
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $request_delay = self::DEFAULT_REQUEST_DELAY;
/** @OA\Property(example=15) */
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $request_threshold = self::DEFAULT_REQUEST_THRESHOLD;
/** @OA\Property(example=0) */
#[ORM\Column(options: ['default' => 0])]
#[ORM\Column(nullable: true, options: ['default' => 0])]
protected ?int $disconnect_deactivate_streamer = self::DEFAULT_DISCONNECT_DEACTIVATE_STREAMER;
/**
@ -237,7 +237,7 @@ class Station implements Stringable
* example="UTC"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $timezone = 'UTC';
/**
@ -246,7 +246,7 @@ class Station implements Stringable
* example="https://example.com/image.jpg"
* )
*/
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $default_album_art_url = null;
#[ORM\OneToMany(mappedBy: 'station', targetEntity: SongHistory::class)]
@ -254,19 +254,34 @@ class Station implements Stringable
protected Collection $history;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'media_storage_location_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(
name: 'media_storage_location_id',
referencedColumnName: 'id',
nullable: true,
onDelete: 'SET NULL'
)]
#[DeepNormalize(true)]
#[Serializer\MaxDepth(1)]
protected ?StorageLocation $media_storage_location = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'recordings_storage_location_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(
name: 'recordings_storage_location_id',
referencedColumnName: 'id',
nullable: true,
onDelete: 'SET NULL'
)]
#[DeepNormalize(true)]
#[Serializer\MaxDepth(1)]
protected ?StorageLocation $recordings_storage_location = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'podcasts_storage_location_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(
name: 'podcasts_storage_location_id',
referencedColumnName: 'id',
nullable: true,
onDelete: 'SET NULL'
)]
#[DeepNormalize(true)]
#[Serializer\MaxDepth(1)]
protected ?StorageLocation $podcasts_storage_location = null;
@ -274,11 +289,11 @@ class Station implements Stringable
#[ORM\OneToMany(mappedBy: 'station', targetEntity: StationStreamer::class)]
protected Collection $streamers;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $current_streamer_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'current_streamer_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
#[ORM\JoinColumn(name: 'current_streamer_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?StationStreamer $current_streamer = null;
#[ORM\OneToMany(mappedBy: 'station', targetEntity: RolePermission::class)]

View File

@ -39,14 +39,14 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="69b536afc7ebbf16457b8645"
* )
*/
#[ORM\Column(length: 25)]
#[ORM\Column(length: 25, nullable: true)]
protected ?string $unique_id = null;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $storage_location_id;
#[ORM\ManyToOne(inversedBy: 'media')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StorageLocation $storage_location;
/**
@ -55,7 +55,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="Test Album"
* )
*/
#[ORM\Column(length: 200)]
#[ORM\Column(length: 200, nullable: true)]
protected ?string $album = null;
/**
@ -64,7 +64,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="Rock"
* )
*/
#[ORM\Column(length: 30)]
#[ORM\Column(length: 30, nullable: true)]
protected ?string $genre = null;
/**
@ -73,7 +73,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="...Never gonna give you up..."
* )
*/
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $lyrics = null;
/**
@ -82,7 +82,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="GBARL0600786"
* )
*/
#[ORM\Column(length: 15)]
#[ORM\Column(length: 15, nullable: true)]
protected ?string $isrc = null;
/**
@ -91,7 +91,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=240.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 7, scale: 2)]
#[ORM\Column(type: 'decimal', precision: 7, scale: 2, nullable: true)]
protected ?float $length = 0.00;
/**
@ -100,7 +100,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example="4:00"
* )
*/
#[ORM\Column(length: 10)]
#[ORM\Column(length: 10, nullable: true)]
protected ?string $length_text = '0:00';
/**
@ -118,7 +118,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=SAMPLE_TIMESTAMP
* )
*/
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $mtime = 0;
/**
@ -127,7 +127,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=-14.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $amplify = null;
/**
@ -136,7 +136,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=2.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $fade_overlap = null;
/**
@ -145,7 +145,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=3.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $fade_in = null;
/**
@ -154,7 +154,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=3.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $fade_out = null;
/**
@ -163,7 +163,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=30.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $cue_in = null;
/**
@ -172,7 +172,7 @@ class StationMedia implements SongInterface, ProcessableMediaInterface, PathAwar
* example=30.00
* )
*/
#[ORM\Column(type: 'decimal', precision: 6, scale: 1)]
#[ORM\Column(type: 'decimal', precision: 6, scale: 1, nullable: true)]
protected ?float $cue_out = null;
/**

View File

@ -15,21 +15,21 @@ class StationMediaCustomField
use Traits\HasAutoIncrementId;
use Traits\TruncateStrings;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $media_id;
#[ORM\ManyToOne(inversedBy: 'metadata')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationMedia $media;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $field_id;
#[ORM\ManyToOne(inversedBy: 'media_fields')]
#[ORM\JoinColumn(name: 'field_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'field_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected CustomField $field;
#[ORM\Column(name: 'field_value', length: 255)]
#[ORM\Column(name: 'field_value', length: 255, nullable: true)]
protected ?string $value = null;
public function __construct(StationMedia $media, CustomField $field)

View File

@ -24,11 +24,11 @@ class StationMount implements StationMountInterface, \Stringable
use Traits\HasAutoIncrementId;
use Traits\TruncateStrings;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'mounts')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
/** @OA\Property(example="/radio.mp3") */
@ -37,7 +37,7 @@ class StationMount implements StationMountInterface, \Stringable
protected string $name = '';
/** @OA\Property(example="128kbps MP3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $display_name = null;
/** @OA\Property(example=true) */
@ -53,15 +53,15 @@ class StationMount implements StationMountInterface, \Stringable
protected bool $is_public = false;
/** @OA\Property(example="/error.mp3") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $fallback_mount = null;
/** @OA\Property(example="http://radio.example.com:8000/radio.mp3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $relay_url = null;
/** @OA\Property(example="") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $authhash = null;
/** @OA\Property(example=true) */
@ -69,19 +69,19 @@ class StationMount implements StationMountInterface, \Stringable
protected bool $enable_autodj = true;
/** @OA\Property(example="mp3") */
#[ORM\Column(length: 10)]
#[ORM\Column(length: 10, nullable: true)]
protected ?string $autodj_format = 'mp3';
/** @OA\Property(example=128) */
#[ORM\Column(type: 'smallint')]
#[ORM\Column(type: 'smallint', nullable: true)]
protected ?int $autodj_bitrate = 128;
/** @OA\Property(example="https://custom-listen-url.example.com/stream.mp3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $custom_listen_url = null;
/** @OA\Property(type="array", @OA\Items()) */
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $frontend_config = null;
/**

View File

@ -50,11 +50,11 @@ class StationPlaylist implements Stringable
public const OPTION_PLAY_SINGLE_TRACK = 'single_track';
public const OPTION_MERGE = 'merge';
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'playlists')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
/** @OA\Property(example="Test Playlist") */
@ -84,11 +84,11 @@ class StationPlaylist implements Stringable
protected string $order = self::ORDER_SHUFFLE;
/** @OA\Property(example="http://remote-url.example.com/stream.mp3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $remote_url = null;
/** @OA\Property(example="stream") */
#[ORM\Column(length: 25)]
#[ORM\Column(length: 25, nullable: true)]
#[Assert\Choice(choices: [self::REMOTE_TYPE_STREAM, self::REMOTE_TYPE_PLAYLIST])]
protected ?string $remote_type = self::REMOTE_TYPE_STREAM;
@ -148,7 +148,7 @@ class StationPlaylist implements Stringable
protected bool $include_in_automation = false;
/** @OA\Property(example="interrupt,loop_once,single_track,merge") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $backend_options = '';
/** @OA\Property(example=true) */

View File

@ -17,11 +17,11 @@ class StationPlaylistFolder implements PathAwareInterface
use Traits\TruncateStrings;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'folders')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationPlaylist $playlist;
#[ORM\Column(length: 500)]

View File

@ -15,18 +15,18 @@ class StationPlaylistMedia implements JsonSerializable
{
use Traits\HasAutoIncrementId;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $playlist_id;
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'media_items')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationPlaylist $playlist;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $media_id;
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'playlists')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationMedia $media;
#[ORM\Column]

View File

@ -17,44 +17,44 @@ class StationQueue implements SongInterface
use Traits\TruncateInts;
use Traits\HasSongFields;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'history')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $playlist_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'playlist_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationPlaylist $playlist = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $media_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationMedia $media = null;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $request_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'request_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'request_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?StationRequest $request = null;
#[ORM\Column]
protected bool $sent_to_autodj = false;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $autodj_custom_uri = null;
#[ORM\Column]
protected int $timestamp_cued;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $duration = null;
#[ORM\Column(type: 'json', nullable: true)]

View File

@ -28,22 +28,22 @@ class StationRemote implements StationMountInterface, Stringable
use Traits\HasAutoIncrementId;
use Traits\TruncateStrings;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'remotes')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $relay_id = null;
#[ORM\ManyToOne(inversedBy: 'remotes')]
#[ORM\JoinColumn(name: 'relay_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'relay_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?Relay $relay = null;
/** @OA\Property(example="128kbps MP3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $display_name = null;
/** @OA\Property(example=true) */
@ -60,43 +60,43 @@ class StationRemote implements StationMountInterface, Stringable
protected bool $enable_autodj = false;
/** @OA\Property(example="mp3") */
#[ORM\Column(length: 10)]
#[ORM\Column(length: 10, nullable: true)]
protected ?string $autodj_format = null;
/** @OA\Property(example=128) */
#[ORM\Column(type: 'smallint')]
#[ORM\Column(type: 'smallint', nullable: true)]
protected ?int $autodj_bitrate = null;
/** @OA\Property(example="https://custom-listen-url.example.com/stream.mp3") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $custom_listen_url = null;
/** @OA\Property(example="http://custom-url.example.com") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $url = null;
/** @OA\Property(example="/stream.mp3") */
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
protected ?string $mount = null;
/** @OA\Property(example="password") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $admin_password = null;
/** @OA\Property(example=8000) */
#[ORM\Column(type: 'smallint', options: ['unsigned' => true])]
#[ORM\Column(type: 'smallint', nullable: true, options: ['unsigned' => true])]
protected ?int $source_port = null;
/** @OA\Property(example="/") */
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
protected ?string $source_mount = null;
/** @OA\Property(example="source") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $source_username = null;
/** @OA\Property(example="password") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $source_password = null;
/** @OA\Property(example=false) */

View File

@ -17,18 +17,18 @@ class StationRequest
{
use Traits\HasAutoIncrementId;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'media')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $track_id;
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: 'track_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'track_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationMedia $track;
#[ORM\Column]

View File

@ -37,10 +37,10 @@ class StationSchedule
#[ORM\Column(type: 'smallint')]
protected int $end_time = 0;
#[ORM\Column(length: 10)]
#[ORM\Column(length: 10, nullable: true)]
protected ?string $start_date = null;
#[ORM\Column(length: 10)]
#[ORM\Column(length: 10, nullable: true)]
protected ?string $end_date = null;
/**
@ -49,7 +49,7 @@ class StationSchedule
* example="0,1,2,3"
* )
*/
#[ORM\Column(length: 50)]
#[ORM\Column(length: 50, nullable: true)]
protected ?string $days = null;
public function __construct(StationPlaylist|StationStreamer $relation)

View File

@ -34,11 +34,11 @@ class StationStreamer implements \Stringable
use Traits\HasAutoIncrementId;
use Traits\TruncateStrings;
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'streamers')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
/** @OA\Property(example="dj_test") */
@ -53,11 +53,11 @@ class StationStreamer implements \Stringable
protected string $streamer_password;
/** @OA\Property(example="Test DJ") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $display_name = null;
/** @OA\Property(example="This is a test DJ account.") */
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $comments = null;
/** @OA\Property(example=true) */
@ -69,7 +69,7 @@ class StationStreamer implements \Stringable
protected bool $enforce_schedule = false;
/** @OA\Property(example=SAMPLE_TIMESTAMP) */
#[ORM\Column]
#[ORM\Column(nullable: true)]
#[Attributes\AuditIgnore]
protected ?int $reactivate_at = null;

View File

@ -24,11 +24,11 @@ class StationStreamerBroadcast
use Traits\TruncateStrings;
#[ORM\ManyToOne(inversedBy: 'streamer_broadcasts')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
#[ORM\ManyToOne(inversedBy: 'broadcasts')]
#[ORM\JoinColumn(name: 'streamer_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'streamer_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StationStreamer $streamer;
#[ORM\Column(name: 'timestamp_start')]
@ -37,7 +37,7 @@ class StationStreamerBroadcast
#[ORM\Column(name: 'timestamp_end')]
protected int $timestampEnd = 0;
#[ORM\Column(name: 'recording_path', length: 255)]
#[ORM\Column(name: 'recording_path', length: 255, nullable: true)]
protected ?string $recordingPath = null;
public function __construct(StationStreamer $streamer)

View File

@ -34,11 +34,11 @@ class StationWebhook implements Stringable
public const TRIGGER_STATION_OFFLINE = 'station_offline';
public const TRIGGER_STATION_ONLINE = 'station_online';
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $station_id;
#[ORM\ManyToOne(inversedBy: 'webhooks')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'station_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Station $station;
/**
@ -47,7 +47,7 @@ class StationWebhook implements Stringable
* example="Twitter Post"
* )
*/
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $name = null;
/**

View File

@ -63,37 +63,37 @@ class StorageLocation implements Stringable
])]
protected string $adapter = self::ADAPTER_LOCAL;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
protected ?string $path = null;
#[ORM\Column(name: 's3_credential_key', length: 255)]
#[ORM\Column(name: 's3_credential_key', length: 255, nullable: true)]
protected ?string $s3CredentialKey = null;
#[ORM\Column(name: 's3_credential_secret', length: 255)]
#[ORM\Column(name: 's3_credential_secret', length: 255, nullable: true)]
protected ?string $s3CredentialSecret = null;
#[ORM\Column(name: 's3_region', length: 150)]
#[ORM\Column(name: 's3_region', length: 150, nullable: true)]
protected ?string $s3Region = null;
#[ORM\Column(name: 's3_version', length: 150)]
#[ORM\Column(name: 's3_version', length: 150, nullable: true)]
protected ?string $s3Version = 'latest';
#[ORM\Column(name: 's3_bucket', length: 255)]
#[ORM\Column(name: 's3_bucket', length: 255, nullable: true)]
protected ?string $s3Bucket = null;
#[ORM\Column(name: 's3_endpoint', length: 255)]
#[ORM\Column(name: 's3_endpoint', length: 255, nullable: true)]
protected ?string $s3Endpoint = null;
#[ORM\Column(name: 'dropbox_auth_token', length: 255)]
#[ORM\Column(name: 'dropbox_auth_token', length: 255, nullable: true)]
protected ?string $dropboxAuthToken = null;
#[ORM\Column(name: 'storage_quota', type: 'bigint')]
#[ORM\Column(name: 'storage_quota', type: 'bigint', nullable: true)]
protected ?string $storageQuota = null;
// Used for API generation.
protected ?string $storageQuotaBytes = null;
#[ORM\Column(name: 'storage_used', type: 'bigint')]
#[ORM\Column(name: 'storage_used', type: 'bigint', nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $storageUsed = null;

View File

@ -11,11 +11,12 @@ use OpenApi\Annotations as OA;
trait HasAutoIncrementId
{
/** @OA\Property() */
#[ORM\Column, ORM\Id, ORM\GeneratedValue]
protected int $id;
#[ORM\Column(nullable: false)]
#[ORM\Id, ORM\GeneratedValue]
protected ?int $id = null;
public function getId(): ?int
{
return $this->id ?? null;
return $this->id;
}
}

View File

@ -18,15 +18,15 @@ trait HasSongFields
protected string $song_id;
/** @OA\Property() */
#[ORM\Column(length: 303)]
#[ORM\Column(length: 303, nullable: true)]
protected ?string $text = null;
/** @OA\Property() */
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
protected ?string $artist = null;
/** @OA\Property() */
#[ORM\Column(length: 150)]
#[ORM\Column(length: 150, nullable: true)]
protected ?string $title = null;
public function setSong(SongInterface $song): void

View File

@ -12,12 +12,12 @@ use OpenApi\Annotations as OA;
trait HasUniqueId
{
/** @OA\Property() */
#[ORM\Column(type: 'guid', unique: true)]
#[ORM\Column(type: 'guid', unique: true, nullable: false)]
#[ORM\Id, ORM\GeneratedValue(strategy: 'CUSTOM'), ORM\CustomIdGenerator(UuidV6Generator::class)]
protected string $id;
protected ?string $id = null;
public function getId(): ?string
{
return $this->id ?? null;
return $this->id;
}
}

View File

@ -19,20 +19,20 @@ class UnprocessableMedia implements ProcessableMediaInterface, PathAwareInterfac
public const REPROCESS_THRESHOLD_MINIMUM = 604800; // One week
#[ORM\Column]
#[ORM\Column(nullable: false)]
protected int $storage_location_id;
#[ORM\ManyToOne(inversedBy: 'media')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'storage_location_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected StorageLocation $storage_location;
#[ORM\Column(length: 500)]
protected string $path;
#[ORM\Column]
#[ORM\Column(nullable: true)]
protected ?int $mtime = 0;
#[ORM\Column(type: 'text')]
#[ORM\Column(type: 'text', nullable: true)]
protected ?string $error = null;
public function __construct(StorageLocation $storageLocation, string $path)

View File

@ -34,12 +34,12 @@ class User implements Stringable
use Traits\TruncateStrings;
/** @OA\Property(example="demo@azuracast.com") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
#[Assert\NotBlank]
#[Assert\Email]
protected ?string $email = null;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $auth_password = null;
@ -47,20 +47,20 @@ class User implements Stringable
protected ?string $new_password = null;
/** @OA\Property(example="Demo Account") */
#[ORM\Column(length: 100)]
#[ORM\Column(length: 100, nullable: true)]
protected ?string $name = null;
/** @OA\Property(example="en_US") */
#[ORM\Column(length: 25)]
#[ORM\Column(length: 25, nullable: true)]
protected ?string $locale = null;
/** @OA\Property(example="dark") */
#[ORM\Column(length: 25)]
#[ORM\Column(length: 25, nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $theme = null;
/** @OA\Property(example="A1B2C3D4") */
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
#[Attributes\AuditIgnore]
protected ?string $two_factor_secret = null;

View File

@ -16,7 +16,7 @@ class UserLoginToken
use Traits\HasSplitTokenFields;
#[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'api_keys')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected User $user;
#[ORM\Column]