Skip to content

feat(doctrine): boolean filter like laravel filters - #6749

Closed
vinceAmstoutz wants to merge 1 commit into
api-platform:mainfrom
vinceAmstoutz:feat-doctrine-boolean-filter-like-laravel-filters
Closed

feat(doctrine): boolean filter like laravel filters#6749
vinceAmstoutz wants to merge 1 commit into
api-platform:mainfrom
vinceAmstoutz:feat-doctrine-boolean-filter-like-laravel-filters

Conversation

@vinceAmstoutz

@vinceAmstoutz vinceAmstoutz commented Oct 24, 2024

Copy link
Copy Markdown
Member
Q A
Branch? main
License MIT
Doc PR Coming soon

Goal:

Using filters as we use Laravel filters. Example with Symfony:

#[ApiResource]
#[GetCollection(
    parameters: [
        'active' => new QueryParameter(
            filter: new BooleanFilter(),
        ),

        // support also for filter aliasing
        'enabled' => new QueryParameter(
            filter: new BooleanFilter(),
            property: 'active',
        ),
    ],
)]
#[ORM\Entity]
class FilteredBooleanParameter {
    // ...
}

TODO:

  • Check swagger UI to see what it's like
  • Do the job for Doctrine ODM (MongoDM)
  • Fix PHPStan
  • Fix MongoDM tests

Comment thread src/Doctrine/Orm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Orm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Orm/Extension/ParameterExtension.php Outdated
Comment thread src/Hydra/Serializer/CollectionFiltersNormalizer.php Outdated
Comment thread src/Serializer/SerializerFilterContextBuilder.php Outdated
Comment thread src/Symfony/Bundle/Resources/config/doctrine_orm.xml Outdated
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 6 times, most recently from cc689c3 to c5de0d4 Compare October 26, 2024 14:14
@vinceAmstoutz

Copy link
Copy Markdown
Member Author

@soyuka looks like this in Swagger UI:
image
image
image

@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 7 times, most recently from 2e2f570 to 1892e6a Compare October 26, 2024 18:47
@vinceAmstoutz
vinceAmstoutz marked this pull request as ready for review October 26, 2024 18:57
@vinceAmstoutz
vinceAmstoutz requested a review from soyuka October 26, 2024 18:57

@soyuka soyuka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start! A few comments left to be done!

Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Filter/AbstractFilter.php Outdated
Comment thread src/Doctrine/Odm/Filter/AbstractFilter.php Outdated
Comment thread src/Doctrine/Odm/Filter/BooleanFilter.php Outdated
Comment thread src/Doctrine/Orm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Orm/Filter/BooleanFilter.php Outdated
Comment thread tests/Functional/Parameters/BooleanFilterTest.php Outdated
Comment thread tests/Functional/Parameters/BooleanFilterTest.php Outdated
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 5 times, most recently from 04a24ac to b1026cb Compare October 31, 2024 15:35
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Filter/AbstractFilter.php
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 3 times, most recently from 6887caf to a5fe140 Compare November 4, 2024 11:26
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Extension/ParameterExtension.php Outdated
Comment thread src/Doctrine/Odm/Filter/AbstractFilter.php Outdated
Comment thread src/Doctrine/Odm/Filter/ManagerRegistryConfigurableInterface.php Outdated
Comment thread src/Doctrine/Orm/Filter/ManagerRegistryConfigurableInterface.php Outdated
Comment thread src/Doctrine/Orm/PropertyHelperTrait.php
Comment thread tests/Functional/Parameters/BooleanFilterTest.php Outdated
Comment thread tests/Functional/Parameters/BooleanFilterTest.php Outdated
Comment thread tests/Functional/Parameters/BooleanFilterTest.php Outdated
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 2 times, most recently from 1130a1a to 13c15dd Compare November 4, 2024 16:02
@vinceAmstoutz
vinceAmstoutz requested a review from soyuka November 4, 2024 16:02
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch 2 times, most recently from c5c4b19 to cbe1cff Compare November 5, 2024 09:00
@vinceAmstoutz
vinceAmstoutz force-pushed the feat-doctrine-boolean-filter-like-laravel-filters branch from cbe1cff to fd22d9c Compare November 5, 2024 09:25
@vinceAmstoutz
vinceAmstoutz deleted the feat-doctrine-boolean-filter-like-laravel-filters branch November 5, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants