<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

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

/**
 * Phone entity mapping all columns from oc_mv_phones.
 *
 * @method int getMemberId()
 * @method void setMemberId(int $memberId)
 * @method string|null getLabel()
 * @method void setLabel(?string $label)
 * @method string getNumberE164()
 * @method void setNumberE164(string $numberE164)
 */
class Phone extends Entity implements JsonSerializable {

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

    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,
            'numberE164' => $this->numberE164,
        ];
    }
}
