mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +02:00
Fixed the use of the removed ClassMetadataInfo constants
This commit is contained in:
parent
7d9be5ae76
commit
60325e797d
4 changed files with 11 additions and 11 deletions
|
@ -30,7 +30,7 @@ use App\Entity\Base\AbstractDBElement;
|
|||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
|
||||
|
||||
/**
|
||||
|
@ -212,7 +212,7 @@ trait PKImportHelperTrait
|
|||
$id = (int) $id;
|
||||
|
||||
$metadata = $this->em->getClassMetadata($element::class);
|
||||
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
|
||||
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
|
||||
$metadata->setIdGenerator(new AssignedGenerator());
|
||||
$metadata->setIdentifierValues($element, ['id' => $id]);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ use Brick\Math\BigDecimal;
|
|||
use DateTime;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Mapping\MappingException;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
|
@ -136,16 +136,16 @@ class TimeTravel
|
|||
|
||||
//Revert many-to-one association (one element in property)
|
||||
if (
|
||||
ClassMetadataInfo::MANY_TO_ONE === $mapping['type']
|
||||
|| ClassMetadataInfo::ONE_TO_ONE === $mapping['type']
|
||||
ClassMetadata::MANY_TO_ONE === $mapping['type']
|
||||
|| ClassMetadata::ONE_TO_ONE === $mapping['type']
|
||||
) {
|
||||
$target_element = $this->getField($element, $field);
|
||||
if (null !== $target_element && $element->getLastModified() > $timestamp) {
|
||||
$this->revertEntityToTimestamp($target_element, $timestamp, $reverted_elements);
|
||||
}
|
||||
} elseif ( //Revert *_TO_MANY associations (collection properties)
|
||||
(ClassMetadataInfo::MANY_TO_MANY === $mapping['type']
|
||||
|| ClassMetadataInfo::ONE_TO_MANY === $mapping['type'])
|
||||
(ClassMetadata::MANY_TO_MANY === $mapping['type']
|
||||
|| ClassMetadata::ONE_TO_MANY === $mapping['type'])
|
||||
&& !$mapping['isOwningSide']
|
||||
) {
|
||||
$target_elements = $this->getField($element, $field);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue