Skip to content

Commit

Permalink
Remove the reverse setter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhelias committed Nov 16, 2023
1 parent 2cf3ed7 commit d8e00ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 1 addition & 2 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
->args([
service('annotation_reader')->nullOnInvalid(), // @deprecated
service(EntityManagerInterface::class),
service('encryption.indexes_generator'),
service('property_accessor')
service('encryption.indexes_generator')
])
->alias(IndexableFieldsService::class, 'encryption.indexable_field')

Expand Down
10 changes: 1 addition & 9 deletions src/Services/IndexableFieldsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Doctrine\Common\Annotations\Reader;
use Doctrine\ORM\EntityManagerInterface;
use Odandb\DoctrineCiphersweetEncryptionBundle\Exception\UndefinedGeneratorException;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;

class IndexableFieldsService
{
Expand All @@ -20,14 +19,12 @@ class IndexableFieldsService
private ?Reader $annReader;
private EntityManagerInterface $em;
private IndexesGenerator $indexesGenerator;
private PropertyAccessorInterface $propertyAccessor;

public function __construct(?Reader $annReader, EntityManagerInterface $em, IndexesGenerator $generator, PropertyAccessorInterface $propertyAccessor)
public function __construct(?Reader $annReader, EntityManagerInterface $em, IndexesGenerator $generator)
{
$this->annReader = $annReader;
$this->em = $em;
$this->indexesGenerator = $generator;
$this->propertyAccessor = $propertyAccessor;
}

/**
Expand Down Expand Up @@ -176,11 +173,6 @@ public function handleIndexableFieldsForEntity(object $entity, array $fieldsCont
}
}
}

$setter = 'set' . $refClass->getShortName();
if ($this->propertyAccessor->isWritable($entity, $setter)) {
$this->propertyAccessor->setValue($entity, $setter, $indexEntities);
}
}
}

Expand Down

0 comments on commit d8e00ea

Please sign in to comment.