Switch to attribute for "Station Requires Restart" detection.
This commit is contained in:
parent
aedb329948
commit
b7984a5f75
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue