src/Entity/Redactor.php line 44
<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiProperty;
use Doctrine\DBAL\Types\Types;
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;
use App\Repository\RedactorRepository,
App\Security\Voter\ArchivableVoter,
App\Lib\Actions;
#[ApiResource(
description: 'Redactors',
normalizationContext: ['groups' => [
'read',
'read:' . self::class,
'read:' . self::class . 'Translation',
'read:' . AbstractAuthor::class,
'read:' . AbstractAuthor::class . 'Translation'
]],
denormalizationContext: ['groups' => ['write']],
security: 'is_granted("' . self::class . '")',
order: ['ord' => 'desc'],
operations: [
new GetCollection(),
new Post(),
new Get(),
new Put(),
new Delete(
securityPostDenormalize: 'is_granted("' . Actions::DELETE . '", object)',
securityPostDenormalizeMessage: ArchivableVoter::MESSAGE
),
],
extraProperties: ['standard_put' => false],
)]
#[ORM\Entity(repositoryClass: RedactorRepository::class)]
class Redactor extends AbstractAuthor
{
#[ApiProperty(description: 'Import id of employee from old database')]
#[ORM\Column(type: Types::INTEGER, nullable: true)]
protected ?int $importEmployeeId = null;
public function getImportEmployeeId(): ?int
{
return $this->importEmployeeId;
}
public function setImportEmployeeId(?int $importEmployeeId): self
{
$this->importEmployeeId = $importEmployeeId;
return $this;
}
public function getType(): string
{
return 'redactor';
}
}