src/Entity/Traits/ImplementNotifyChangeTrackingPolicy.php
private function updatePropertyValue(string $propName, $newValue): void
    {
        if ($this->$propName === $newValue) {
            return;
        }
        $oldValue        = $this->$propName;
        $this->$propName = $newValue;
        foreach ($this->notifyChangeTrackingListeners as $listener) {
            $listener->propertyChanged($this, $propName, $oldValue, $newValue);
        }
    }
private function updatePropertyValue(string $propName, $newValue): void
    {
        if ($this->$propName === $newValue) {
            return;
        }
        $oldValue        = $this->$propName;
        $this->$propName = $newValue;
        foreach ($this->notifyChangeTrackingListeners as $listener) {
            $listener->propertyChanged($this, $propName, $oldValue, $newValue);
        }
    }
private function updatePropertyValue ( string $ propName , $ newValue ) : void { if ( $ this -> $ propName === $ newValue ) { return ; } $ oldValue = $ this -> $ propName ; $ this -> $ propName = $ newValue ; foreach ( $ this -> notifyChangeTrackingListeners as $ listener ) { $ listener -> propertyChanged ( $ this , $ propName , $ oldValue , $ newValue ) ; } }
To be called from all set methods

This method updates the property value, then it runs this through validation
If validation fails, it sets the old value back and throws the caught exception
If validation passes, it then performs the Doctrine notification for property change

@param string $propName
@param mixed  $newValue

@throws ValidationException
To be called from all set methods