<?php
namespace App\Domain\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Delete;
use ApiPlatform\Metadata\Post;
use App\Domain\Entity\Behavior\Identifiable;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class PersonPointOfInterest
*
* @package App\Domain\Entity
*/
#[ApiResource(
operations : [
new Delete(
uriTemplate: '/person_point_of_interest/{uuid}',
security : "is_granted('ROLE_ADMIN') or object.person.id == user.id"
),
new Post(uriTemplate: '/person_point_of_interest'),
],
normalizationContext : ['groups' => ['person_point_of_interest_read']],
denormalizationContext: ['groups' => ['person_point_of_interest_write']],
order : ['createAd' => 'DESC']
)]
class PersonPointOfInterest
{
use Identifiable;
use Timestampable;
public function __construct(
public Person $person,
public PointOfInterest $pointOfInterest,
public ?\DateTime $zhistUpdate = null
) {
}
}