<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

use JsonSerializable;
use OCP\AppFramework\Db\Entity;

/**
 * Email entity mapping all columns from oc_mv_emails.
 *
 * @method int getMemberId()
 * @method void setMemberId(int $memberId)
 * @method string|null getLabel()
 * @method void setLabel(?string $label)
 * @method string getEmail()
 * @method void setEmail(string $email)
 */
class Email extends Entity implements JsonSerializable {

    protected int $memberId = 0;
    protected ?string $label = null;
    protected string $email = '';

    public function __construct() {
        $this->addType('id', 'integer');
        $this->addType('memberId', 'integer');
    }

    public function jsonSerialize(): array {
        return [
            'id' => $this->id,
            'memberId' => $this->memberId,
            'label' => $this->label,
            'email' => $this->email,
        ];
    }
}
