File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,6 @@ class Anomaly implements SpacecraftDestroyerInterface
3838 #[Column(type: 'integer ' )]
3939 private int $ anomaly_type_id ;
4040
41- #[Column(type: 'integer ' , nullable: true )]
42- private ?int $ locationId = null ;
43-
44- #[Column(type: 'integer ' , nullable: true )]
45- private ?int $ parent_id = null ;
46-
4741 #[Column(type: 'text ' , nullable: true )]
4842 private ?string $ data = null ;
4943
@@ -56,7 +50,7 @@ class Anomaly implements SpacecraftDestroyerInterface
5650 private ?Location $ location = null ;
5751
5852 #[ManyToOne(targetEntity: Anomaly::class, inversedBy: 'children ' )]
59- #[JoinColumn(name: 'parent_id ' , referencedColumnName: 'id ' )]
53+ #[JoinColumn(name: 'parent_id ' , nullable: true , referencedColumnName: 'id ' )]
6054 private ?Anomaly $ parent = null ;
6155
6256 /**
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ public function findAllRoot(): array
6565 return $ this ->getEntityManager ()
6666 ->createQuery (
6767 sprintf (
68- 'SELECT a FROM %s a
69- WHERE a.parent_id IS NULL ' ,
68+ 'SELECT a FROM %s a
69+ WHERE a.parent IS NULL ' ,
7070 Anomaly::class
7171 )
7272 )
@@ -79,10 +79,10 @@ public function getActiveCountByTypeWithoutParent(AnomalyTypeEnum $type): int
7979 return (int ) $ this ->getEntityManager ()
8080 ->createQuery (
8181 sprintf (
82- 'SELECT count(a.id) FROM %s a
82+ 'SELECT count(a.id) FROM %s a
8383 WHERE a.anomaly_type_id = :type
8484 AND a.remaining_ticks > 0
85- AND a.parent_id IS NULL ' ,
85+ AND a.parent IS NULL ' ,
8686 Anomaly::class
8787 )
8888 )
You can’t perform that action at this time.
0 commit comments