<?php

namespace Planaday\Entities\Course\DTO;

class ApiAttribute {
	protected string $name = '';
	protected string $code = '';
	protected bool $isRequired = false;
	protected bool $forBooking = false;
	protected bool $multipleValuesAllowed = false;
	protected bool $isFinancial = false;
	/** @var ApiAttributeValue[] */
	protected array $values = [];
	protected string $description = '';

	public function setName( ?string $name ): static {
		$this->name = $name ?? $this->name;

		return $this;
	}

	public function setCode( ?string $code ): static {
		$this->code = $code ?? $this->code;

		return $this;
	}

	public function setIsRequired( ?bool $isRequired ): static {
		$this->isRequired = $isRequired ?? $this->isRequired;

		return $this;
	}

	public function setForBooking( ?bool $forBooking ): static {
		$this->forBooking = $forBooking ?? $this->forBooking;

		return $this;
	}

	public function setMultipleValuesAllowed( ?bool $multipleValuesAllowed ): static {
		$this->multipleValuesAllowed = $multipleValuesAllowed ?? $this->multipleValuesAllowed;

		return $this;
	}

	public function setIsFinancial( ?bool $isFinancial ): static {
		$this->isFinancial = $isFinancial ?? $this->isFinancial;

		return $this;
	}

	/**
	 * @param ApiAttributeValue[] $values
	 *
	 * @return $this
	 */
	public function setValues( ?array $values ): static {
		$this->values = $values ?? $this->values;

		return $this;
	}
	
	public function setDescription( ?string $description ): static {
		$this->description = $description ?? $this->description;
		return $this;
	}
	
	public function getDescription(): string {
		return $this->description;
	}
	
	public function getName(): string {
		return $this->name;
	}

	public function getCode(): string {
		return $this->code;
	}

	public function isRequired(): bool {
		return $this->isRequired;
	}

	public function isForBooking(): bool {
		return $this->forBooking;
	}

	public function isMultipleValuesAllowed(): bool {
		return $this->multipleValuesAllowed;
	}

	public function isFinancial(): bool {
		return $this->isFinancial;
	}

	/**
	 * @return ApiAttributeValue[]
	 */
	public function getValues(): array {
		return $this->values;
	}
}