src/Entity/PageThumb.php line 39
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiResource,
ApiPlatform\Metadata\Get,
ApiPlatform\Metadata\GetCollection,
ApiPlatform\Metadata\Put;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use App\Entity\AbstractThumb,
App\Lib\Actions,
App\StateProcessor\ThumbProcessor,
App\Repository\PageThumbRepository,
App\Security\Voter\PageVoter;
#[ApiResource(
description: 'Page thumbs',
normalizationContext: ['groups' => ['read', 'read:' . AbstractThumb::class]],
denormalizationContext: ['groups' => ['write']],
security: 'is_granted("' . Page::class . '")',
order: ['property' => 'asc', 'type' => 'asc', 'name' => 'asc'],
operations: [
new GetCollection(),
new Get(),
new Put(
processor: ThumbProcessor::class,
securityPostDenormalize: 'is_granted("' . Actions::EDIT . '", object)',
securityPostDenormalizeMessage: PageVoter::EDIT_MESSAGE
),
],
extraProperties: ['standard_put' => false],
)]
#[Vich\Uploadable]
// #[ORM\UniqueConstraint(fields: ['parent', 'property', 'name'])]
#[ORM\Entity(repositoryClass: PageThumbRepository::class)]
class PageThumb extends AbstractThumb
{
}