mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix code style for AccompanyingPeriodWorkEvaluation
This commit is contained in:
parent
1826b20b40
commit
4bd50d0148
@ -50,6 +50,27 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
|
|||||||
$this->prependApis($container);
|
$this->prependApis($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function prependApis(ContainerBuilder $container)
|
||||||
|
{
|
||||||
|
$container->prependExtensionConfig('chill_main', [
|
||||||
|
'apis' => [
|
||||||
|
[
|
||||||
|
'class' => \Chill\DocStoreBundle\Entity\StoredObject::class,
|
||||||
|
'name' => 'stored_object',
|
||||||
|
'base_path' => '/api/1.0/docstore/stored-object',
|
||||||
|
'base_role' => 'ROLE_USER',
|
||||||
|
'actions' => [
|
||||||
|
'_entity' => [
|
||||||
|
'methods' => [
|
||||||
|
Request::METHOD_POST => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
protected function prependAuthorization(ContainerBuilder $container)
|
protected function prependAuthorization(ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$container->prependExtensionConfig('security', [
|
$container->prependExtensionConfig('security', [
|
||||||
@ -86,25 +107,4 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
|
|||||||
];
|
];
|
||||||
$container->prependExtensionConfig('twig', $twigConfig);
|
$container->prependExtensionConfig('twig', $twigConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function prependApis(ContainerBuilder $container)
|
|
||||||
{
|
|
||||||
$container->prependExtensionConfig('chill_main', [
|
|
||||||
'apis' => [
|
|
||||||
[
|
|
||||||
'class' => \Chill\DocStoreBundle\Entity\StoredObject::class,
|
|
||||||
'name' => 'stored_object',
|
|
||||||
'base_path' => '/api/1.0/docstore/stored-object',
|
|
||||||
'base_role' => 'ROLE_USER',
|
|
||||||
'actions' => [
|
|
||||||
'_entity' => [
|
|
||||||
'methods' => [
|
|
||||||
Request::METHOD_POST => true,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,11 @@ use Chill\DocStoreBundle\Entity\StoredObject;
|
|||||||
use Chill\DocStoreBundle\Repository\StoredObjectRepository;
|
use Chill\DocStoreBundle\Repository\StoredObjectRepository;
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||||
|
use function array_key_exists;
|
||||||
|
use function is_array;
|
||||||
|
|
||||||
class StoredObjectDenormalizer implements DenormalizerInterface {
|
class StoredObjectDenormalizer implements DenormalizerInterface
|
||||||
|
{
|
||||||
private StoredObjectRepository $storedObjectRepository;
|
private StoredObjectRepository $storedObjectRepository;
|
||||||
|
|
||||||
public function __construct(StoredObjectRepository $storedObjectRepository)
|
public function __construct(StoredObjectRepository $storedObjectRepository)
|
||||||
@ -44,8 +46,6 @@ class StoredObjectDenormalizer implements DenormalizerInterface {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $type === StoredObject::class;
|
return StoredObject::class === $type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
@ -33,7 +33,6 @@ use function is_array;
|
|||||||
class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface
|
class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface
|
||||||
{
|
{
|
||||||
use DenormalizerAwareTrait;
|
use DenormalizerAwareTrait;
|
||||||
|
|
||||||
use ObjectToPopulateTrait;
|
use ObjectToPopulateTrait;
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
@ -56,7 +55,7 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm
|
|||||||
));
|
));
|
||||||
|
|
||||||
//if (in_array('accompanying_period_work:edit', $context['groups'] ?? [], true)) {
|
//if (in_array('accompanying_period_work:edit', $context['groups'] ?? [], true)) {
|
||||||
$this->handleEvaluationCollection($data, $evaluation, $format, $context);
|
$this->handleEvaluationCollection($data, $evaluation, $format, $context);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
return $evaluation;
|
return $evaluation;
|
||||||
@ -102,7 +101,7 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm
|
|||||||
}
|
}
|
||||||
// handle the documents kept
|
// handle the documents kept
|
||||||
foreach ($kept as $k) {
|
foreach ($kept as $k) {
|
||||||
dump($k);// Cannot iterate over $kept which is a PersistentCollection
|
dump($k); // Cannot iterate over $kept which is a PersistentCollection
|
||||||
$evaluation->removeDocument($k);
|
$evaluation->removeDocument($k);
|
||||||
dump($evaluation);
|
dump($evaluation);
|
||||||
$document = $this->denormalizer->denormalize(
|
$document = $this->denormalizer->denormalize(
|
||||||
|
@ -15,10 +15,15 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add title to AccompanyingPeriodWorkEvaluationDocument
|
* Add title to AccompanyingPeriodWorkEvaluationDocument.
|
||||||
*/
|
*/
|
||||||
final class Version20220224145951 extends AbstractMigration
|
final class Version20220224145951 extends AbstractMigration
|
||||||
{
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document DROP title');
|
||||||
|
}
|
||||||
|
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Add title to AccompanyingPeriodWorkEvaluationDocument';
|
return 'Add title to AccompanyingPeriodWorkEvaluationDocument';
|
||||||
@ -28,9 +33,4 @@ final class Version20220224145951 extends AbstractMigration
|
|||||||
{
|
{
|
||||||
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD title TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD title TEXT DEFAULT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document DROP title');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user