<?php
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 Gedmo\SoftDeleteable\Traits\SoftDeleteable;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class PressKit
*
* @package App\Domain\Entity
*/
#[ApiResource(
operations : [
new Delete(security: "is_granted('ROLE_ADMIN')"),
new Get(),
new GetCollection(filters: ['press.search_filter', 'soft_delete_filter']),
new Post(security: "is_granted('ROLE_ADMIN')"),
new Put(security: "is_granted('ROLE_ADMIN')"),
],
normalizationContext : ['groups' => ['press_visual_kit_read']],
denormalizationContext: ['groups' => ['press_visual_kit_write']]
)]
class PressVisualkit
{
use Identifiable;
use SoftDeleteable;
use Timestampable;
/**
* @param Locale $locale
* @param Media|null $file
* @param string|null $fileName
* @param bool|null $isVisible
* @param string|null $title
*/
public function __construct(
public Locale $locale,
public ?Media $file = null,
public ?string $fileName = null,
public ?bool $isVisible = null,
public ?string $title = null,
) {
}
}