src/Entity/LandingPageBlock.php line 49
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiResource,
ApiPlatform\Metadata\Get,
ApiPlatform\Metadata\GetCollection,
ApiPlatform\Metadata\Post,
ApiPlatform\Metadata\Put,
ApiPlatform\Metadata\Delete,
ApiPlatform\Metadata\ApiFilter,
ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
use App\Doctrine\Attribute\TargetEntity,
App\Repository\LandingPageBlockRepository;
use App\Enum\BlockType,
App\Filter\IriFilter;
#[ApiResource(
description: 'Landing page blocks',
normalizationContext: ['groups' => [
'read',
'read:' . self::class,
'read:' . self::class . 'Translation',
'read:' . AbstractThumb::class,
'read:' . AbstractBlock::class,
'read:' . AbstractBlockTranslation::class,
'read:' . AbstractBlockTranslationLogo::class,
'read:' . AbstractBlockTranslationFile::class
]],
denormalizationContext: ['groups' => ['write']],
security: 'is_granted("' . Page::class . '")',
order: ['ord' => 'desc'],
operations: [
new GetCollection(),
new Post(denormalizationContext: ['groups' => ['write', 'post']]),
new Get(),
new Put(),
new Delete(),
],
extraProperties: ['standard_put' => false],
)]
#[ApiFilter(IriFilter::class, properties: ['parent'])]
#[ApiFilter(OrderFilter::class, properties: ['ord'])]
#[TargetEntity(mappings: ['parent' => LandingPage::class])]
#[ORM\Entity(repositoryClass: LandingPageBlockRepository::class)]
class LandingPageBlock extends AbstractBlock
{
public function __construct(LandingPage $parent, BlockType $type)
{
parent::__construct($parent, $type);
}
}