Switch to attribute for "Station Requires Restart" detection.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-05-31 10:16:45 -05:00
parent aedb329948
commit b7984a5f75
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
1 changed files with 2 additions and 9 deletions

View File

@ -4,7 +4,6 @@ namespace App\Doctrine\Event;
use App\Entity;
use App\Entity\Attributes\AuditIgnore;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Events;
@ -16,11 +15,6 @@ use ReflectionObject;
*/
class StationRequiresRestart implements EventSubscriber
{
public function __construct(
protected Reader $reader
) {
}
/**
* @inheritDoc
*/
@ -58,9 +52,8 @@ class StationRequiresRestart implements EventSubscriber
$class_reflection = new ReflectionObject($entity);
foreach ($changes as $change_field => $changeset) {
$property = $class_reflection->getProperty($change_field);
$annotation = $this->reader->getPropertyAnnotation($property, AuditIgnore::class);
if (null !== $annotation) {
$ignoreAttr = $property->getAttributes(AuditIgnore::class);
if (!empty($ignoreAttr)) {
unset($changes[$change_field]);
}
}