metadataPool = $metadataPool; $this->hydratorPool = $hydratorPool; $this->objectRelationProcessor = $objectRelationProcessor; } /** * @param string $entityType * @param object $entity * @throws \Exception * @return void */ public function execute($entityType, $entity) { $metadata = $this->metadataPool->getMetadata($entityType); $hydrator = $this->hydratorPool->getHydrator($entityType); $this->objectRelationProcessor->validateDataIntegrity( $metadata->getEntityTable(), $hydrator->extract($entity) ); } }