<?php

declare(strict_types=1);

/*
 * This file is part of the VitiCore 2.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\SocialNetwork\Model;

use ApiPlatform\Metadata\ApiProperty;
use CpCreation\VitiCore\Behavior\HasTimestamp;
use CpCreation\VitiCore\Behavior\Impl\Timestamp;
use CpCreation\VitiCore\SocialNetwork\Repository\SocialNetworkNewRepository;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;

#[ORM\Entity(repositoryClass: SocialNetworkNewRepository::class)]
#[ORM\Table(name: 'socialnetwork_socialnetworkNew')]
#[ORM\HasLifecycleCallbacks]
class SocialNetworkNew implements HasTimestamp
{
    use Timestamp;

    #[ORM\Id]
    #[ORM\Column(type: 'uuid')]
    #[ORM\GeneratedValue(strategy: 'NONE')]
    #[ApiProperty(iris: ['https://schema.org/identifier'])]
    private UuidInterface $id;

    #[ORM\Column(type: 'string')]
    private string $connectId;

    #[ORM\Column(type: 'string', nullable: true)]
    private ?string $username = null;

    #[ORM\Column(type: 'string')]
    private string $network;

    #[ORM\Column(type: 'json')]
    private array $data = [];

    public function __construct()
    {
        $this->id = Uuid::uuid4();
        $this->data = [];
    }

    public function getId(): UuidInterface
    {
        return $this->id;
    }

    public function getConnectId(): string
    {
        return $this->connectId;
    }

    public function setConnectId(string $connectId): void
    {
        $this->connectId = $connectId;
    }

    public function getUsername(): ?string
    {
        return $this->username;
    }

    public function setUsername(?string $username): void
    {
        $this->username = $username;
    }

    public function getNetwork(): string
    {
        return $this->network;
    }

    public function setNetwork(string $network): void
    {
        $this->network = $network;
    }

    public function getData(): array
    {
        return $this->data;
    }

    public function setData(array $data): void
    {
        $this->data = $data;
    }
}
