Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ composer.lock
/vendor/
/var/
phpstan.neon
/config/reference.php

# Meilisearch
/data.ms/*
Expand Down
3 changes: 0 additions & 3 deletions tests/Entity/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class Article extends ContentItem
{
Expand Down
3 changes: 0 additions & 3 deletions tests/Entity/Car.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class Car
{
Expand Down
31 changes: 1 addition & 30 deletions tests/Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,26 @@

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
*
* @ORM\Table(name="comments")
*/
#[ORM\Entity]
#[ORM\Table(name: 'comments')]
class Comment
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer", nullable=true)
*
* @Groups({"searchable"})
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: Types::INTEGER)]
#[Groups('searchable')]
private ?int $id = null;

/**
* @ORM\ManyToOne(targetEntity="Post", inversedBy="comments")
*
* @ORM\JoinColumn(nullable=false)
*/
#[ORM\ManyToOne(inversedBy: 'comments')]
#[ORM\JoinColumn(nullable: false)]
private Post $post;

/**
* @ORM\Column(type="text")
*
* @Groups({"searchable"})
*/
#[ORM\Column(type: Types::TEXT)]
#[Groups('searchable')]
private string $content;

/**
* @ORM\Column(type="datetime_immutable")
*
* @Groups({"searchable"})
*/
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
#[Groups('searchable')]
private \DateTimeImmutable $publishedAt;
Expand Down
3 changes: 0 additions & 3 deletions tests/Entity/ContentAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Entity\Aggregator;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class ContentAggregator extends Aggregator
{
Expand Down
19 changes: 0 additions & 19 deletions tests/Entity/ContentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,17 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*
* @ORM\InheritanceType("JOINED")
*
* @ORM\DiscriminatorColumn(name="type", type="integer")
*
* @ORM\DiscriminatorMap({1 = Article::class, 2 = Podcast::class})
*/
#[ORM\Entity]
#[ORM\InheritanceType('JOINED')]
#[ORM\DiscriminatorColumn(name: 'type', type: 'integer')]
#[ORM\DiscriminatorMap([1 => Article::class, 2 => Podcast::class])]
abstract class ContentItem
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: Types::INTEGER)]
private ?int $id = null;

/**
* @ORM\Column(type="string")
*/
#[ORM\Column(type: Types::STRING)]
private string $title;

Expand Down
24 changes: 1 addition & 23 deletions tests/Entity/DummyCustomGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,20 @@

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class DummyCustomGroups
{
/**
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue("NONE")
*
* @Groups("public")
*/
#[ORM\Id]
#[ORM\Column(type: Types::INTEGER)]
#[Groups('public')]
private int $id;

/**
* @ORM\Column(type="string")
*
* @Groups("public")
*/
#[ORM\Column(type: Types::STRING)]
#[Groups('public')]
private string $name;

/**
* @ORM\Column(type="datetime_immutable")
*
* @Groups("private")
*/
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
#[Groups('private')]
private \DateTimeImmutable $createdAt;
Expand Down
13 changes: 0 additions & 13 deletions tests/Entity/DynamicSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,13 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class DynamicSettings
{
/**
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue("NONE")
*/
#[ORM\Id]
#[ORM\Column(type: Types::INTEGER)]
private int $id;

/**
* @ORM\Column(type="string")
*/
#[ORM\Column(type: Types::STRING)]
private string $name;

Expand Down
3 changes: 0 additions & 3 deletions tests/Entity/EmptyAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Entity\Aggregator;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class EmptyAggregator extends Aggregator
{
Expand Down
13 changes: 0 additions & 13 deletions tests/Entity/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,14 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class Image
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: Types::INTEGER)]
private ?int $id = null;

/**
* @ORM\Column(type="string")
*/
#[ORM\Column(type: Types::STRING)]
private string $url;

Expand Down
17 changes: 0 additions & 17 deletions tests/Entity/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,19 @@
use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class Link implements NormalizableInterface
{
/**
* @ORM\Id
*
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\Column(type: Types::INTEGER)]
private int $id;

/**
* @ORM\Column(type="string")
*/
#[ORM\Column(type: Types::STRING)]
private string $name;

/**
* @ORM\Column(type="string")
*/
#[ORM\Column(type: Types::STRING)]
private string $url;

/**
* @ORM\Column(type="boolean", options={"default"=false})
*/
#[ORM\Column(type: Types::BOOLEAN, options: ['default' => false])]
private bool $isSponsored;

Expand Down
24 changes: 1 addition & 23 deletions tests/Entity/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,21 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Tests\Entity\ObjectId\DummyObjectId;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
*
* @ORM\Table(name="pages")
*/
#[ORM\Entity]
#[ORM\Table(name: 'pages')]
class Page
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="NONE")
*
* @ORM\Column(type="dummy_object_id")
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'NONE')]
#[ORM\Column(type: 'dummy_object_id')]
private DummyObjectId $id;

/**
* @ORM\Column(type="string", nullable=true)
*
* @Groups({"searchable"})
*/
#[ORM\Column(type: Types::STRING)]
#[Groups('searchable')]
private string $title;

/**
* @ORM\Column(type="text", nullable=true)
*
* @Groups({"searchable"})
*/
#[ORM\Column(type: Types::TEXT)]
#[Groups('searchable')]
private string $content;
Expand Down
3 changes: 0 additions & 3 deletions tests/Entity/Podcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class Podcast extends ContentItem
{
Expand Down
Loading
Loading