<?php
namespace App\Domain\Entity\PointOfInterest;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use App\Domain\Entity\Behavior\Identifiable;
use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class CampingInformation
*
* @package App\Domain\Entity\PointOfInterest
*/
#[ApiResource(
operations : [
new Get(),
new GetCollection(),
new Post(),
],
normalizationContext : ['groups' => ['camping_information_read']],
denormalizationContext: ['groups' => ['camping_information_write']]
)]
class CampingInformation
{
use Identifiable;
use SoftDeleteable;
use Timestampable;
public function __construct(
public ?bool $animal = null,
public ?bool $barbecue = null,
public ?bool $ccPassage = null,
public ?bool $ffcAdvantage = null,
public ?string $ffcAdvantageDescription = null,
public ?bool $mandatoryParking = null,
public ?int $minimumSleep = null,
public ?bool $naturist = null,
public ?int $notation = null,
public ?bool $stopWelcome = null,
public ?string $stopWelcomeDescription = null,
public ?string $surface = null,
) {}
public function getNotationString(): string | null
{
if (!$this->notation) {
return $this->notation;
}
return str_repeat('*', $this->notation);
}
}