<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

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

/**
 * Lager-Teilnehmer (camp participant) entity mapping oc_mv_lager_teilnehmer.
 *
 * Part of Issue #54.
 *
 * @method int getLagerId()
 * @method void setLagerId(int $lagerId)
 * @method int getMemberId()
 * @method void setMemberId(int $memberId)
 * @method string getRolle()
 * @method void setRolle(string $rolle)
 */
class LagerTeilnehmer extends Entity implements JsonSerializable {

    protected int $lagerId = 0;
    protected int $memberId = 0;
    protected string $rolle = 'Teilnehmer';

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

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