mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: entity name
This commit is contained in:
@@ -6,8 +6,8 @@ export const entityToName = (e: { entity: Entity }): string => {
|
||||
|
||||
const jCard = vCard.fromJSON(e.entity.jCard)
|
||||
let name = e.entity.handle
|
||||
if (jCard.data.fn && !Array.isArray(jCard.data.fn) && jCard.data.fn.valueOf() !== '') name = jCard.data.fn.valueOf()
|
||||
if (jCard.data.org && !Array.isArray(jCard.data.org) && jCard.data.org.valueOf() !== '') name = jCard.data.org.valueOf()
|
||||
if (jCard.data.fn && !Array.isArray(jCard.data.fn) && jCard.data.fn.valueOf() !== '') name = jCard.data.fn.valueOf()
|
||||
|
||||
return name
|
||||
}
|
||||
@@ -110,6 +110,8 @@ class Domain
|
||||
* @var Collection<int, DomainStatus>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: DomainStatus::class, mappedBy: 'domain', orphanRemoval: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
#[SerializedName('oldStatus')]
|
||||
private Collection $domainStatuses;
|
||||
|
||||
private const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value];
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Entity;
|
||||
use App\Repository\DomainStatusRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
|
||||
#[ORM\Entity(repositoryClass: DomainStatusRepository::class)]
|
||||
class DomainStatus
|
||||
@@ -19,12 +20,15 @@ class DomainStatus
|
||||
private ?Domain $domain = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[Groups(['domain:item'])]
|
||||
private ?\DateTimeImmutable $date = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
private array $addStatus = [];
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
private array $deleteStatus = [];
|
||||
|
||||
public function __construct()
|
||||
|
||||
Reference in New Issue
Block a user