[PLUGIN] ProfileColor color settings can be null.

This commit is contained in:
Eliseu Amaro 2021-10-05 19:12:51 +01:00
parent a268aee53a
commit 78dd7137f8

View File

@ -39,8 +39,8 @@ class ProfileColor extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $actor_id; private int $actor_id;
private string $color; private ?string $color;
private string $background; private ?string $background;
private \DateTimeInterface $created; private \DateTimeInterface $created;
private \DateTimeInterface $modified; private \DateTimeInterface $modified;
@ -61,7 +61,7 @@ class ProfileColor extends Entity
return $this; return $this;
} }
public function getColor(): string public function getColor(): ?string
{ {
return $this->color; return $this->color;
} }
@ -72,7 +72,7 @@ class ProfileColor extends Entity
return $this; return $this;
} }
public function getBackground(): string public function getBackground(): ?string
{ {
return $this->background; return $this->background;
} }
@ -107,8 +107,8 @@ class ProfileColor extends Entity
'name' => 'profile_color', 'name' => 'profile_color',
'fields' => [ 'fields' => [
'actor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to actor table'], 'actor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to actor table'],
'background' => ['type' => 'text', 'not null' => true, 'description' => 'color hex code'], 'background' => ['type' => 'text', 'description' => 'color hex code'],
'color' => ['type' => 'text', 'not null' => true, 'description' => 'color hex code'], 'color' => ['type' => 'text', 'description' => 'color hex code'],
'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created', 'default' => 'CURRENT_TIMESTAMP'], 'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created', 'default' => 'CURRENT_TIMESTAMP'],
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified', 'default' => 'CURRENT_TIMESTAMP'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified', 'default' => 'CURRENT_TIMESTAMP'],
], ],