Skip to content

Commit

Permalink
Merge branch '3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
metaclass-nl committed Jan 12, 2024
2 parents 9033b29 + 88762fb commit 37b1098
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/DependencyInjection/MetaclassFilterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MetaclassFilterExtension extends Extension
{
/**
* {@inheritDoc}
* @return void
*/
public function load(array $configs, ContainerBuilder $container)
{
Expand Down
36 changes: 19 additions & 17 deletions tests/Entity/TestEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@
/**
* Class TestEntity
* @package Metaclass\FilterBundle\Entity
* @ORM\Entity
* ApiResource
* ApiFilter(DateFilter::class, properties={"dd": DateFilterInterface::INCLUDE_NULL_AFTER})
* ApiFilter(ExistsFilter::class, properties={"dd", "bool", "toMany.bool"})
* ApiFilter(AddFakeLeftJoin::class)
* ApiFilter(SearchFilter::class, properties={"toMany.text"})
* ApiFilter(FilterLogic::class, arguments={"innerJoinsLeft"=true})
* ApiFilter(RemoveFakeLeftJoin::class)
*/
#[ORM\Entity]
#[ApiResource]
#[ApiFilter(DateFilter::class, properties: ["dd" => DateFilterInterface::INCLUDE_NULL_AFTER])]
#[ApiFilter(ExistsFilter::class, properties: ["dd", "bool", "toMany.bool"])]
Expand All @@ -39,45 +32,54 @@ class TestEntity
/**
* @var int The entity Id
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* ORM\Id
* ORM\GeneratedValue
* ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type:"integer")]
public $id = 0;

/**
* @var float
* @ORM\Column(type="float")
* ORM\Column(type="float")
*/
#[ORM\Column(type:"float")]
public $numb = 0.0;

/**
* @var string
* @ORM\Column
* ORM\Column
*/
#[ORM\Column]
public $text;

/**
* @var \DateTime|null
* @ORM\Column(type="date", nullable=true)
* ORM\Column(type="date", nullable=true)
*/
#[ORM\Column(type:"date", nullable:true)]
public $dd;

/**
* @var bool|null
* @ORM\Column(type="boolean", nullable=true)
* ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type:"boolean", nullable:true)]
public $bool;

/**
* @var TestRelated
* @ORM\ManyToOne(targetEntity="Metaclass\FilterBundle\Entity\TestRelated", inversedBy="toMany")
* ORM\ManyToOne(targetEntity="Metaclass\FilterBundle\Entity\TestRelated", inversedBy="toMany")
*/
#[ORM\ManyToOne(targetEntity:"Metaclass\FilterBundle\Entity\TestRelated", inversedBy:"toMany")]
public $toOneNullable;

/**
* @var Collection
* @ORM\OneToMany(targetEntity="Metaclass\FilterBundle\Entity\TestRelated", mappedBy="project")
* ORM\OneToMany(targetEntity="Metaclass\FilterBundle\Entity\TestRelated", mappedBy="project")
*/
#[ORM\OneToMany(targetEntity:"Metaclass\FilterBundle\Entity\TestRelated", mappedBy:"project")]
public $toMany;
}
19 changes: 12 additions & 7 deletions tests/Entity/TestRelated.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,50 @@
* @package Metaclass\FilterBundle\Entity
* @ORM\Entity
*/
#[ORM\Entity]
class TestRelated
{
/**
* @var int The entity Id
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type:"integer")]
public $id = 0;

/**
* @var float
* @ORM\Column(type="float")
*/
#[ORM\Column(type:"float")]
public $numb = 0.0;

/**
* @var string
* @ORM\Column
* ORM\Column
*/
#[ORM\Column]
public $text;

/**
* @var \DateTime|null
* @ORM\Column(type="date", nullable=true)
* ORM\Column(type="date", nullable=true)
*/
#[ORM\Column(type:"date", nullable:true)]
public $dd;

/**
* @var bool|null
* @ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type:"boolean", nullable:true)]
public $bool;

/**
* @var TestEntity
* @ORM\ManyToOne(targetEntity="Metaclass\FilterBundle\Entity\TestEntity", inversedBy="toMany")
* @ORM\JoinColumn(referencedColumnName="id", nullable=false)
*/
#[ORM\ManyToOne(targetEntity:"Metaclass\FilterBundle\Entity\TestEntity", inversedBy:"toMany")]
#[ORM\JoinColumn(referencedColumnName:"id", nullable:false)]
public $testEntity;
}

0 comments on commit 37b1098

Please sign in to comment.