mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
@ -57,7 +57,7 @@ class DBElementRepository extends EntityRepository
|
|||
public function changeID(AbstractDBElement $element, int $new_id): void
|
||||
{
|
||||
$qb = $this->createQueryBuilder('element');
|
||||
$q = $qb->update(get_class($element), 'element')
|
||||
$q = $qb->update($element::class, 'element')
|
||||
->set('element.id', $new_id)
|
||||
->where('element.id = ?1')
|
||||
->setParameter(1, $element->getID())
|
||||
|
@ -87,7 +87,7 @@ class DBElementRepository extends EntityRepository
|
|||
|
||||
protected function setField(AbstractDBElement $element, string $field, int $new_value): void
|
||||
{
|
||||
$reflection = new ReflectionClass(get_class($element));
|
||||
$reflection = new ReflectionClass($element::class);
|
||||
$property = $reflection->getProperty($field);
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($element, $new_value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue