Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests
Browse files Browse the repository at this point in the history
ottaviano committed Mar 22, 2023

Verified

This commit was signed with the committer’s verified signature.
booc0mtaco Holloway
1 parent 087fa68 commit 986852e
Showing 3 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions migrations/Version20230322154120.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20230322154120 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE geo_city DROP FOREIGN KEY FK_297C2D349D25CF90');
$this->addSql('ALTER TABLE
geo_city
ADD
CONSTRAINT FK_297C2D349D25CF90 FOREIGN KEY (replacement_id) REFERENCES geo_city (id) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE geo_city DROP FOREIGN KEY FK_297C2D349D25CF90');
$this->addSql('ALTER TABLE
geo_city
ADD
CONSTRAINT FK_297C2D349D25CF90 FOREIGN KEY (replacement_id) REFERENCES geo_city (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
}
}
1 change: 1 addition & 0 deletions src/Entity/Geo/City.php
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ class City implements ZoneableInterface
* @var City|null
*
* @ORM\ManyToOne(targetEntity="App\Entity\Geo\City")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $replacement;

1 change: 0 additions & 1 deletion src/Normalizer/ItemNormalizerDecorator.php
Original file line number Diff line number Diff line change
@@ -264,7 +264,6 @@ public function denormalize($data, $class, $format = null, array $context = [])

$context['api_denormalize'] = true;

# GOTO:
if ($this->resourceClassResolver->isResourceClass($class)) {
$newResourceClass = $this->resourceClassResolver->getResourceClass($objectToPopulate, $class);
if (!(new \ReflectionClass($newResourceClass))->isAbstract()) {

0 comments on commit 986852e

Please sign in to comment.