src/app/n2n/impl/persistence/orm/property/relation/JoinTableToManyRelation.php
public function supplyPersistAction(PersistAction $persistAction, $value, ValueHash $valueHash, 
			?ValueHash $oldValueHash) {
		ArgUtils::assertTrue($oldValueHash === null || $oldValueHash instanceof ToManyValueHash);
		if ($oldValueHash !== null && $oldValueHash->checkForUntouchedProxy($value)) return;
		
		$targetIdProperty = $this->targetEntityModel->getIdDef()->getEntityProperty();
				
		$toManyAnalyzer = new ToManyAnalyzer($persistAction->getActionQueue());
		$toManyAnalyzer->analyze($value);

		$hasher = new ToManyValueHasher($targetIdProperty);
		
		if ($oldValueHash !== null && !$toManyAnalyzer->hasPendingPersistActions() 
				&& $hasher->matches($toManyAnalyzer->getEntityIds(), $oldValueHash)) {
			return;
		}
		
		$joinTableAction = $this->createJoinTableActionFromPersistAction($persistAction);
		
		foreach ($toManyAnalyzer->getEntityIds() as $targetEntityId) {
			$joinTableAction->addInverseJoinIdRaw($targetIdProperty->buildRaw($targetEntityId, $joinTableAction->getPdo()));
		}
		
		foreach ($toManyAnalyzer->getPendingPersistActions() as $key => $targetPersistAction) {
			$joinTableAction->addDependent($targetPersistAction);
			$targetPersistAction->executeAtEnd(function () use ($joinTableAction, $targetPersistAction, $targetIdProperty, $hasher, $key, $valueHash) {
				$targetId = $targetPersistAction->getId();
				$joinTableAction->addInverseJoinIdRaw($targetIdProperty->buildRaw($targetId, $joinTableAction->getPdo()));
				$hasher->reportId($key, $targetId, $valueHash);
			});
		}
	}
public function supplyPersistAction(PersistAction $persistAction, $value, ValueHash $valueHash, 
			?ValueHash $oldValueHash) {
		ArgUtils::assertTrue($oldValueHash === null || $oldValueHash instanceof ToManyValueHash);
		if ($oldValueHash !== null && $oldValueHash->checkForUntouchedProxy($value)) return;
		
		$targetIdProperty = $this->targetEntityModel->getIdDef()->getEntityProperty();
				
		$toManyAnalyzer = new ToManyAnalyzer($persistAction->getActionQueue());
		$toManyAnalyzer->analyze($value);

		$hasher = new ToManyValueHasher($targetIdProperty);
		
		if ($oldValueHash !== null && !$toManyAnalyzer->hasPendingPersistActions() 
				&& $hasher->matches($toManyAnalyzer->getEntityIds(), $oldValueHash)) {
			return;
		}
		
		$joinTableAction = $this->createJoinTableActionFromPersistAction($persistAction);
		
		foreach ($toManyAnalyzer->getEntityIds() as $targetEntityId) {
			$joinTableAction->addInverseJoinIdRaw($targetIdProperty->buildRaw($targetEntityId, $joinTableAction->getPdo()));
		}
		
		foreach ($toManyAnalyzer->getPendingPersistActions() as $key => $targetPersistAction) {
			$joinTableAction->addDependent($targetPersistAction);
			$targetPersistAction->executeAtEnd(function () use ($joinTableAction, $targetPersistAction, $targetIdProperty, $hasher, $key, $valueHash) {
				$targetId = $targetPersistAction->getId();
				$joinTableAction->addInverseJoinIdRaw($targetIdProperty->buildRaw($targetId, $joinTableAction->getPdo()));
				$hasher->reportId($key, $targetId, $valueHash);
			});
		}
	}
/* (non-PHPdoc)
@see \n2n\impl\persistence\orm\property\relation\Relation::supplyPersistAction()