File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 10
10
use Meilisearch \Bundle \SearchableEntity ;
11
11
use Meilisearch \Bundle \SearchService ;
12
12
use Meilisearch \Bundle \Tests \Entity \Comment ;
13
+ use Meilisearch \Bundle \Tests \Entity \ExternalLink ;
13
14
use Meilisearch \Bundle \Tests \Entity \Image ;
14
15
use Meilisearch \Bundle \Tests \Entity \Link ;
15
16
use Meilisearch \Bundle \Tests \Entity \ObjectId \DummyObjectId ;
@@ -148,7 +149,7 @@ protected function createTag(array $properties = []): Tag
148
149
149
150
protected function createLink (array $ properties = []): Link
150
151
{
151
- $ link = new Link ();
152
+ $ link = new ExternalLink ();
152
153
$ link ->setName ('Meilisearch Test Link ' );
153
154
154
155
if (count ($ properties ) > 0 ) {
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Meilisearch \Bundle \Tests \Entity ;
6
+
7
+ use Doctrine \ORM \Mapping as ORM ;
8
+
9
+ /**
10
+ * @ORM\Entity
11
+ */
12
+ #[ORM \Entity]
13
+ class ExternalLink extends Link
14
+ {
15
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Meilisearch \Bundle \Tests \Entity ;
6
+
7
+ use Doctrine \ORM \Mapping as ORM ;
8
+
9
+ /**
10
+ * @ORM\Entity
11
+ */
12
+ #[ORM \Entity]
13
+ class InternalLink extends Link
14
+ {
15
+ }
Original file line number Diff line number Diff line change 12
12
13
13
/**
14
14
* @ORM\Entity
15
+ *
16
+ * @ORM\InheritanceType("JOINED")
17
+ *
18
+ * @ORM\DiscriminatorColumn(name="type", type="integer")
19
+ *
20
+ * @ORM\DiscriminatorMap({1 = ExternalLink::class, 2 = InternalLink::class})
15
21
*/
16
22
#[ORM \Entity]
17
- class Link implements NormalizableInterface
23
+ #[ORM \InheritanceType('JOINED ' )]
24
+ #[ORM \DiscriminatorColumn(name: 'type ' , type: 'integer ' )]
25
+ #[ORM \DiscriminatorMap([1 => ExternalLink::class, 2 => InternalLink::class])]
26
+ abstract class Link implements NormalizableInterface
18
27
{
19
28
/**
20
29
* @ORM\Id
You can’t perform that action at this time.
0 commit comments