<?php
declare(strict_types=1);
namespace App\Domain\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Delete;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use App\Domain\Entity\Behavior\Identifiable;
use App\Domain\Entity\PointOfInterest\Revision;
use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
use Gedmo\Timestampable\Traits\Timestampable;
#[ApiResource(
operations: [
new Delete(security: "is_granted('ROLE_ADMIN')"),
new GetCollection(filters: ['step.search_filter', 'step.query_filter', 'soft_delete_filter']),
new Get(),
new Post(security: "is_granted('ROLE_ADMIN')"),
new Put(security: "is_granted('ROLE_ADMIN')"),
],
normalizationContext: ['groups' => ['step_read']],
denormalizationContext: ['groups' => ['step_write']],
filters: ['translation.groups'],
)]
class Step
{
use Identifiable;
use SoftDeleteable;
use Timestampable;
public ?\DateTime $zhistUpdate = null;
public function __construct(
public ?bool $status = null,
public ?Revision $revision = null,
) {}
}