src/Modelling/ModelState.php
final public function addPropertyChangedNotificationHandler($propertyNames, $callback)
    {
        if (!is_array($propertyNames)) {
            $propertyNames = [$propertyNames];
        }

        foreach ($propertyNames as $propertyName) {
            $this->propertyChangedCallbacks[$propertyName][] = $callback;
        }
    }
final public function addPropertyChangedNotificationHandler($propertyNames, $callback)
    {
        if (!is_array($propertyNames)) {
            $propertyNames = [$propertyNames];
        }

        foreach ($propertyNames as $propertyName) {
            $this->propertyChangedCallbacks[$propertyName][] = $callback;
        }
    }
final public function addPropertyChangedNotificationHandler ( $ propertyNames , $ callback ) { if ( ! is_array ( $ propertyNames ) ) { $ propertyNames = [ $ propertyNames ] ; } foreach ( $ propertyNames as $ propertyName ) { $ this -> propertyChangedCallbacks [ $ propertyName ] [ ] = $ callback ; } }
When the named properties are changed, the callable method provided will be called and passed details of the change.

@param string|string[] $propertyNames The name of a property, or an array of property names
@param callable $callback A callable which will receive 3 parameters: $newValue, $propertyName, $oldValue
When the named properties are changed the callable method provided will be called and passed details of the change .