Neos\Neos\EventLog\Integrations\ContentRepositoryIntegrationService::beforeNodePropertyChange PHP Method

beforeNodePropertyChange() public method

Emit an event when node properties have been changed
public beforeNodePropertyChange ( Neos\ContentRepository\Domain\Model\NodeInterface $node, $propertyName, $oldValue, $value ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$propertyName
$oldValue
$value
return void
    public function beforeNodePropertyChange(NodeInterface $node, $propertyName, $oldValue, $value)
    {
        if (!$this->eventEmittingService->isEnabled()) {
            return;
        }
        if (count($this->currentNodeAddEvents) > 0) {
            // add is currently running, during that; we do not want any update events
            return;
        }
        if ($oldValue === $value) {
            return;
        }
        if (!isset($this->changedNodes[$node->getContextPath()])) {
            $this->changedNodes[$node->getContextPath()] = array('node' => $node);
        }
        if (!isset($this->changedNodes[$node->getContextPath()]['oldLabel'])) {
            $this->changedNodes[$node->getContextPath()]['oldLabel'] = $node->getLabel();
        }
        $this->changedNodes[$node->getContextPath()]['old'][$propertyName] = $oldValue;
        $this->changedNodes[$node->getContextPath()]['new'][$propertyName] = $value;
    }